Last post Feb 20, 2014 07:41 AM by MSDN_ice
Feb 17, 2014 09:05 AM|johnaspnet|LINK
Recently I have upgraded IoC assembly of Microsoft.Practices.Unity to version 3.0.1304.1 for .NET target 4.5. I do not have any compile errors when building my application. However, I keep seeing a VS code context warning like "deprecated method Microsoft.Practices.Unity.InjectedMembers"
when I hover the mouse over "InjectedMembers" in the following code lines:
IUnityContainer container = new UnityContainer();
container.RegisterType<IRepository, Repository>(new HttpContextLifetimeManager<IRepository>())
So, what is the alternative method and its syntax I should use instead of the "InjectedMembers"?
Please help. Thank you in advance.
Feb 20, 2014 07:41 AM|MSDN_ice|LINK
There is a same issue with solution.
container.RegisterType<IRepository, Repository>(new HttpContextLifetimeManager<IRepository> (), new InjectionConstructor(typeof(DbContext)));