We are developing a website that uses the repository pattern/unit of work approach. We use Autofac to assist with the construction of objects between these tiers of abstraction.
I've written an AutoFac authentication filter that currently grabs Basic Auth headers and creates an IPrincipal object and assigns it to HttpContext.Current.User
In our custom DbContext class I want Autofac to get a copy of this IPrinipal object without having to look into System.Web.HttpContext (in an effort to keep this decoupled)
有没有人对我如何让 …
asp.net-mvc dependency-injection unit-of-work autofac repository-pattern