Null User on HttpContext obtained from StructureMap

I haven’t worked with OWIN, but when hosting in IIS integrated mode the HttpContext is not populated until after the HttpApplication.Start event is complete. In terms of DI, this means that you cannot rely on using properties of HttpContext in any constructor. This makes sense if you think about it because the application should be … Read more

Constructor Dependency Injection WebApi Attributes

Yes, it is possible. You (like most people) are being thrown by Microsoft’s marketing of Action Filter Attributes, which are conveniently put into a single class, but not at all DI-friendly. The solution is to break the Action Filter Attribute into 2 parts as demonstrated in this post: An attribute that contains no behavior to … Read more