On Thu, Jun 4, 2009 at 10:11 AM, Andyk <andym.kni...@googlemail.com> wrote:

>
> Oh dear. That'll cause abit of a rewrite in my code!


That is the primary reason I use the scope based solutions (ActiveRecord,
Rhino Common UoW) since it solves that problem


>
>
> So is the only recommendation to pass the session down through
> function parameters, or by calling some class.Initialise(session)
> function?
>

Others have proposed context based lifestyle manager in which the same
component will be resolved for a given context, but that gets a little
complicated.

Is it possible to stache the ISession in thread local/web local storage?


>
>
> On 4 June, 15:58, Craig Neuwirt <cneuw...@gmail.com> wrote:
> > That is the expected behavior to eliminate undesired and/or unexpected
> > consequences.
> >
> > On Thu, Jun 4, 2009 at 9:56 AM, AndyKnight <andym.kni...@googlemail.com
> >wrote:
> >
> >
> >
> > > Hey everyone,
> > > When using the Resolve<T>(String key, IDictionary arguments) function
> > > in Windsor, will the dictionary arguments only apply to the type
> > > specified, and not to any of its dependencies?
> >
> > > Currently the following class resolves fine when inserting an
> > > NHibernate session into the arguments dictionary:
> > > public class DataService
> > > {
> > >   public DataService(ISession session) {}
> > > }
> >
> > > However, if the ISession is required for additional dependencies below
> > > the DataService class, it fails to resolve:
> > > public class DataService
> > > {
> > >   public DataService(ISession session, IRepository repository) {}
> > > }
> > > public class Repository
> > > {
> > >   public Repository(ISession session) {}
> > > }
> >
> > > with the error:
> > > Can't create component 'repository' as it has dependencies to be
> > > satisfied. repository is waiting for the following dependencies:
> > > Services: - NHibernate.ISession which was not registered.
> >
> > > Regards
> >
> > > Andy
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to castle-project-users@googlegroups.com
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to