Have a couple of questions regarding the latest version (2.2.1.4) of ninject.
Was trying to Bind a Linq2sql DataContext
to a concrete implementation InRequestScope
(in a class library project)
Bind<DataContext>().To<MoneywatchDataContext>()
but could not find InRequestScope
method
ended up doing this,
Bind<DataContext>().To<MoneywatchDataContext>().InScope(ctx => HttpContext.Current)
Just wanted to find out if:
- If this will behave exactly like the
InRequestScope
Method. - That it will gurantee that when my
HTTContext.Current
is GC'ed the underlyingDataCotext
will be disposed as well.
Bind<>().To<>().InRequestScope();
was in the Infrastucure project. I took me a while to realize that. – Exclamation