ASP.NET Web API binding with ninject

后端 未结 11 947
Happy的楠姐
Happy的楠姐 2020-12-12 22:46

I have just installed the mvc4 rc update and I am trying to build an api application with little luck.

I am using ninject but cant get my controllers to load. I keep

11条回答
  •  伪装坚强ぢ
    2020-12-12 23:17

    You can install the NuGet package WebApiContrib.IoC.Ninject and add the following line of code to NinjectWebCommon.cs

    GlobalConfiguration.Configuration.DependencyResolver = new NinjectResolver(kernel);
    

提交回复
热议问题