Ninject InRequestScope missing
InRequestScope is available as extension method in Ninject.Web.Common. So if installed earlier through Nuget (Ninject package) now we might need to install additional nuget package Ninject.Web.Common
InRequestScope is available as extension method in Ninject.Web.Common. So if installed earlier through Nuget (Ninject package) now we might need to install additional nuget package Ninject.Web.Common
If you are using the Ninject.MVC3 nuget package, then some of the article you linked that was causing confusion will not be required. That package has everything you need to start injecting your controllers which is probably the biggest pain point. Upon installing that package, it will create a NinjectMVC3.cs file in the App_Start folder, … Read more
You can use the ToConstant method which takes an already existing instance and registers it as singleton. var kernel = new StandardKernel(); kernel.Bind<MyClass>().ToConstant(myClassInstance); If you want to something more complex you can use the ToMethod (where you can use a Func to get your instance) combined with the InSingletonScope var kernel = new StandardKernel(); kernel.Bind<MyClass>().ToMethod(context … Read more