Using Ninject with Asp.NET Web API Beta ApiController

前端 未结 5 516
没有蜡笔的小新
没有蜡笔的小新 2021-01-31 22:33

I\'m stuck. I was using the method outlined here for wcf web api p6 Ninject working with WCF Web API Preview 5, however things are quite a bit different with the mvc implementat

5条回答
  •  清酒与你
    2021-01-31 23:02

    I never used the WebAPI but since the semantic of the IDependencyResolver is exactly the same as the one from MVC3 you should be able to use the same implementation: https://github.com/ninject/ninject.web.mvc/blob/master/mvc3/src/Ninject.Web.Mvc/NinjectDependencyResolver.cs

    Update: The Ninject.Web.WebAPi extension adds support for ApiControllers

提交回复
热议问题