Germán, Your problem and solution description looks like an *exact* match to what I had in mind. Thank you every so much for taking the time to post it here.
I will grab the solution and keep it for a raining day :-) Thanks Christian On 23 Feb, 21:44, Germán Schuager <[email protected]> wrote: > http://blog.schuager.com/2008/11/custom-windsor-lifestyle.html > > On Mon, Feb 23, 2009 at 5:58 PM, jsimons <[email protected]> wrote: > > > Hi Christian, > > > Why do you need a lifestyle? > > Why not register MyController as transient and Dependencies as > > singleton. > > > Cheers > > John > > > On Feb 24, 7:12 am, christianacca <[email protected]> > > wrote: > > > I would like to define a lifestyle (?) that allows me to do the > > > following > > > > var c1 = IoC.Resolve<MyController>(); > > > var c2 = IoC.Resolve<MyController>(); > > > > Assert.IsTrue(ReferenceEquals(c1.Dependency, c1.Child.Dependency)); > > > Assert.IsTrue(ReferenceEquals(c2.Dependency, c2.Child.Dependency)); > > > Assert.IsFalse(ReferenceEquals(c1.Dependency, c2.Dependency)); > > > > In other words, each instance of MyController should be injected with > > > a new instance of Dependency; that each object within the MyController > > > share the same instance of Dependency. > > > > Any ideas and how this could be acheived (I am expecting the answer > > > will be create a custom ILifestyleManager - in that case I'm looking > > > for some ideas of what the implementation would look like). > > > > Thanks in advance > > > Christian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
