Amir Jalali
Amir Jalali

Reputation: 3212

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?

Upvotes: 1

Views: 3724

Answers (1)

Haney
Haney

Reputation: 34832

In MVC, your dependency container is available as a singleton at System.Web.Mvc.DependencyResolver.Current

Upvotes: 8

Related Questions