Created
March 11, 2014 08:33
-
-
Save mikaelbr/fc6959d5bb4d0b0d3220 to your computer and use it in GitHub Desktop.
Override repositories in EpiServer
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
using EPiServer.Framework; | |
using EPiServer.Framework.Initialization; | |
using EPiServer.ServiceLocation; | |
namespace Business.Initialization | |
{ | |
[InitializableModule] | |
[ModuleDependency(typeof(ServiceContainerInitialization))] | |
public class InitializaCustomRepository : IConfigurableModule | |
{ | |
public void Initialize(InitializationEngine context) | |
{ | |
} | |
public void Uninitialize(InitializationEngine context) | |
{ | |
} | |
public void Preload(string[] parameters) | |
{ | |
} | |
public void ConfigureContainer(ServiceConfigurationContext context) | |
{ | |
context.Container.Configure(x => x.For<EPiServer.Web.Routing.UrlResolver>().Use<Business.MyUrlResolver>()); | |
} | |
} | |
} |
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
namespace Business | |
{ | |
// Same Lifecycle as UrlResolver | |
[ServiceConfiguration(ServiceType = typeof(EPiServer.Web.Routing.UrlResolver), Lifecycle = ServiceInstanceScope.Singleton)] | |
public class MyUrlResolver : EPiServer.Web.Routing.UrlResolver | |
{ | |
// Override all the base | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment