How to get Ninject working with asp.net MVC 5
Install-Package Ninject.MVC5
This will create the file in your solution:
App_Start\NinjectWebCommon.cs
Then to wire up an interface for resolution to a concreate implementation, just:
private static void RegisterServices(IKernel kernel) {
kernel.Bind<ISomeService>().To<SomeConcreateImplementation>();
}
Unity:
Modify UnityConfig.cs to register service
Add this to App_start: UnityConfig.RegisterComponents();
No comments:
Post a Comment