【发布时间】:2014-04-30 10:59:59
【问题描述】:
我正在尝试将IAuthenticationManager 与 Ninject 绑定,以便可以将其注入我的AuthenticationService。问题是我目前在我的Controller 上从HttpContext.GetOwinContext() 获得IAuthenticationManager,如下所示:
private IAuthenticationManager AuthenticationManager {
get {
return this.HttpContext.GetOwinContext().Authentication;
}
}
如何使用 Ninject 创建绑定,以便它知道在运行时从 HttpContext.GetOwinContext() 中查找 IAuthenticationManager?可能吗?我的问题甚至有意义吗?提前致谢!
【问题讨论】:
标签: c# asp.net-mvc ninject asp.net-mvc-5 owin