Hi, I've done something similar here: http://blog.schuager.com/2008/11/custom-windsor-lifestyle.html And although I think that that implementation is a little brittle you can take some ideas from there.
Besides this, I've been experimenting with some way of explicitly defining resolution contexts... something like this: http://gist.github.com/320996(it works for dependencies too) I need to publish this implementation somewhere, but in the meantime if you think it can help ping me and I will send it to you. On Sat, May 8, 2010 at 11:33 AM, Emanuele DelBono <[email protected]>wrote: > Hi all. > > I 'm trying to register some components using Castle Windsor that has > a special treatment. The scenario is: > > I have the class Model1 that has 2 dependencies Repo1 and Repo2 > Then I have a class Model2 that has 1 dependency Repo1 > Repo1 and Repo2 has 1 dependency on NH ISession (using a SessionFactory) > > I would like that Repo1 and Repo2 have the same instance of ISession > if they are dependecies of Model1, but Repo1 should have another > instance if it is part of Model2. > > What I need is that all the repositories of a particular model shares > the same ISession to be able to transact the operations on the > database (1 session per Model). > > Thanks! > > ema > http://blog.codiceplastico.com > > -- > 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]<castle-project-users%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/castle-project-users?hl=en. > > -- 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.
