I'm adding Ninject to my WCF service (hosted in IIS). I intend for the WCF service to automatically instantiate instances of my NHibernate repository classes.
I originally used Castle (and later Ninject) to instantiate those objects in my ASP.NET MVC client and pass them to a service class. In this case, the scope was PerWebRequest (Castle) or InRequestScope (Ninject). The NHibernate session would be implicitly created along with a transaction that would be committed when the repositories were disposed.
I would like to keep this same approach by having the client implicitly control the lifetime of the session/transaction by newing/closing the service.
Would one of the existing Ninject scope methods work in this manner (InThreadScope or InRequestScope perhaps)? Is there another way to achieve this goal?