ninject.web

Ninject per session singleton?

倖福魔咒の 提交于 2019-12-03 13:44:28
问题 So I'm trying to introduce the concept of a user to my application and have got my own set of custom login routines etc. working fine. In my module, I'm binding my IUserSession to my implementation and InSingletonScope. Now I suspect this was the case and have been able to prove that this is not the right thing to do, if I try and login with two users against the same site, I get only one set of data. If I implement a MembershipProvider, do I avoid such a restriction. I know that if I

ASP.NET MVC 3 and Global Filter Injection

大憨熊 提交于 2019-12-03 08:41:23
Hello am an trying to implement a global filter with injection. The filter looks like this. public class WikiFilter : IActionFilter { private IWikiService service; public WikiFilter(IWikiService service) { this.service = service; } public void OnActionExecuting(ActionExecutingContext filterContext) { !!!Code here!! } public void OnActionExecuted(ActionExecutedContext filterContext) { throw new NotImplementedException(); } } And i have attached the filter with injection the following way in my global.asax. public class MvcApplication : System.Web.HttpApplication, IAuthenticationApplication<User

Ninject per session singleton?

走远了吗. 提交于 2019-12-03 04:41:28
So I'm trying to introduce the concept of a user to my application and have got my own set of custom login routines etc. working fine. In my module, I'm binding my IUserSession to my implementation and InSingletonScope. Now I suspect this was the case and have been able to prove that this is not the right thing to do, if I try and login with two users against the same site, I get only one set of data. If I implement a MembershipProvider, do I avoid such a restriction. I know that if I implement a membership provider, I don't have to inject everything, but my login isn't just a username

Ninject w/ ASMX web service in a MVC3/Ninject 3 environment

纵饮孤独 提交于 2019-11-29 14:47:28
I'm looking for the best way to incorporate a classic asmx web service into my MVC3 environment. I'd like the kernel/container to be shared between the two. In the past with ASP.NET web forms I was able to use the following: [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.Web.Script.Services.ScriptService] public class Service : WebServiceBase { [Inject] public IContextProvider ContextProvider { get; set; } ... This used the older Ninject.Web to shared the kernel using the KernelContainer that was shared between WebServiceBase, PageBase, etc. etc. Now I've got a MVC3

Ninject w/ ASMX web service in a MVC3/Ninject 3 environment

帅比萌擦擦* 提交于 2019-11-28 08:41:39
问题 I'm looking for the best way to incorporate a classic asmx web service into my MVC3 environment. I'd like the kernel/container to be shared between the two. In the past with ASP.NET web forms I was able to use the following: [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.Web.Script.Services.ScriptService] public class Service : WebServiceBase { [Inject] public IContextProvider ContextProvider { get; set; } ... This used the older Ninject.Web to shared the kernel using