How to plug my Autofac container into ASP. NET Identity 2.1

后端 未结 5 1234
攒了一身酷
攒了一身酷 2020-12-12 15:29

I have been looking into the new features of the new version of ASP.NET Identity 2.1 and one of its enhancements is the new IoC features integrated into the OWIN Middleware.

5条回答
  •  误落风尘
    2020-12-12 15:56

    I managed the workaround by using autofac service locator:

    app.CreatePerOwinContext(() => DependencyResolver.Current.GetService());
    

    Yes, it is not good enough, but in the mean time, we could use object same scope as declared in autofac registration process.

提交回复
热议问题