kernel.Bind<IRepository>().To<SqlRepository>().InRequestScope();
I am currently using Ninject 3 in an ASP MVC application. What is the best way for me to setup the kernel so that the default scope is the Request scope? Currently I'm having to setup all my bindings similar to the following:kernel.Bind<IRepository>().To<SqlRepository>().InRequestScope();
--
You received this message because you are subscribed to the Google Groups "ninject" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ninject/-/n4cOtB6HOFcJ.
To post to this group, send email to nin...@googlegroups.com.
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ninject?hl=en.
Would that be very difficult to do? https://github.com/ninject/ninject/pull/55 My solution is a bit of a hack, but it looks like it would work.
On Thu, May 10, 2012 at 1:58 PM, Remo Gloor <remo....@bbv.ch> wrote:
You can't! But you can use conventions to reduce the configuration.
I am currently using Ninject 3 in an ASP MVC application. What is the best way for me to setup the kernel so that the default scope is the Request scope? Currently I'm having to setup all my bindings similar to the following:
.
--kernel.Bind<IRepository>().To<SqlRepository>().InRequestScope();
You received this message because you are subscribed to the Google Groups "ninject" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ninject/-/n4cOtB6HOFcJ.
To post to this group, send email to nin...@googlegroups.com.
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ninject?hl=en.
--
You received this message because you are subscribed to the Google Groups "ninject" group.
To post to this group, send email to nin...@googlegroups.com.
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ninject?hl=en.