Unity.Mvc3 vs Unity.Mvc

Using Unity.Mvc3 with the Mvc 3 application, I can register mine IDummyServiceas follows:

container.RegisterType<IDummyService, DummyService>(new HierarchicalLifetimeManager());

Each web request creates a new instance of mine IDummyService(as described in the article ), but since I upgraded Mvc 3 to Mvc 4 and hense Unity.Mvc3 to Unity.Mvc, one instance is created and used in all web requests until the application is restarted . Basically, it IDummyServiceis a singleton in an Mvc 4 application when used HierarchicalLifetimeManager. It’s hard for me to believe that this is intended for new behavior in Unity.Mvc.

Are there any better explanations for this?

+4
source share
1 answer

Unity.Mvc3 Unity.Mvc .

Unity.Mvc3 -. HierarchicalLifetimeManager.

Unity.Mvc , LifetimeManager PerRequestLifetimeManager.

+5

All Articles