我想知道如果你有一个基本控制器,你如何使用ninject 2.0进行构造函数注入?
private readonly IBaseService baseService; public BaseController(IBaseService baseService) { this.baseService = baseService; } Bind<IBaseService>().To<BaseService>(); public class OtherController : BaseController { private readonly IOtherService otherService; public OtherController(IOtherService otherService,IBaseService baseService) { this.otherService = otherService; }
但我得到了
‘BaseController’ does not contain a
constructor that takes 0 arguments