Created
May 16, 2013 15:57
-
-
Save geoffreysmith/5592813 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public static class GlassMapperScCustom | |
{ | |
public static void CastleConfig(IWindsorContainer container) | |
{ | |
var config = new Config(); | |
container.Install(new SitecoreInstaller(config)); | |
container.Register( | |
Component.For<ISitecoreContext>().ImplementedBy<SitecoreContext>().LifestyleTransient(), | |
Component.For<ISitecoreService>().ImplementedBy<SitecoreService>().LifestyleTransient() | |
.DependsOn(Dependency.OnValue<string>("master")) | |
); | |
//ServiceLocator.SetLocatorProvider(() => new WindsorServiceLocator(container)); | |
container.Install(FromAssembly.This()); | |
container.Register(Classes.FromThisAssembly().BasedOn<IController>().LifestyleTransient()); | |
IControllerFactory controllerFactory = new WindsorControllerFactory(container); | |
var scapiSitecoreControllerFactory = new SitecoreControllerFactory(controllerFactory); | |
ControllerBuilder.Current.SetControllerFactory(scapiSitecoreControllerFactory); | |
} | |
public static IConfigurationLoader[] GlassLoaders() | |
{ | |
var attributes = new SitecoreAttributeConfigurationLoader("Domain"); | |
return new IConfigurationLoader[] {attributes}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment