I have tried creating a custom facility and registering RS services as
explained here:
http://github.com/ayende/rhino-security/blob/master/How%20to%20Use.txt
and then registering it in my windsor.boo file like so:
facility NHibernateUnitOfWorkFacility
facility CustomFacility
inside the custom facility after i have register all RS services I
call Kernel.Resolver.AddSubResolver(new
ServiceIsessionResolver(Kernel)) to pass the current ISession to RS
inside the service Isession resolver I have the following method that
tries to pass the current ISession from the UnitOfWorkFactory
public object Resolve(CreationContext context, ISubDependencyResolver
contextHandlerResolver, ComponentModel model, DependencyModel
dependency)
{
return
kernel.Resolve<IUnitOfWorkFactory>().CurrentSession;
}
this is not working because I receive the following exception:
Castle.MicroKernel.Exceptions.CircularDependencyException
+ Service dependency 'CurrentSession' type 'NHibernate.ISession' for
NHibernate.ISession CurrentSession in
Rhino.Commons.NHibernateUnitOfWorkFactory
I have also tried the following:
Kernel.Resolver.AddSubResolver(new
ServiceIsessionResolver(Kernel.Resolve<IUnitOfWorkFactory>()));
and returning the ISession inside the Resolve method like so
return _UoW.CurrentSession;
But this tells me that I need to start a unit of work before I can
call this. What am I doing wrong and is it possible to pass the
NHibernateUnitOfWork ISession to Rhino Security?
--
You received this message because you are subscribed to the Google Groups
"Rhino Tools Dev" 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/rhino-tools-dev?hl=en.