Created
June 26, 2016 10:49
-
-
Save Azadehkhojandi/234a85f1e7fee739e8096199c5608052 to your computer and use it in GitHub Desktop.
Umbraco and unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var container = new UnityContainer(); | |
container.RegisterTypes(AppDomain.CurrentDomain.GetAssemblies().SelectMany(x => x.GetTypes())); | |
container.RegisterTypes(AllClasses.FromLoadedAssemblies()); | |
container.RegisterInstance(typeof(UmbracoHelper), new UmbracoHelper(UmbracoContext.Current)); | |
container.RegisterInstance(typeof(UmbracoContext), UmbracoContext.Current); | |
container.RegisterInstance(typeof(Merchello.Core.IMerchelloContext), MerchelloContext.Current); | |
container.RegisterInstance(typeof(ApplicationContext), ApplicationContext.Current); | |
container.RegisterInstance(typeof(ServiceContext), ApplicationContext.Current.Services); | |
container.RegisterInstance(typeof(Umbraco.Core.Services.IMemberService), ApplicationContext.Current.Services.MemberService); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment