简体   繁体   中英

how to access unity container at application_beginrequest using asp.net mvc and unity?

using asp.net mvc and installing unity bootstraper through nuget.

I was wondering how can I get access to same unity container at "Application_BeginRequest()" , "Application_Error()" , "Application_EndRequest()" that is configured in bootstraper ?

and how can I resolve all instances of an interface at Application_BeginRequest?

在MVC中,您的依赖项容器可作为System.Web.Mvc.DependencyResolver.Current的单例使用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM