Skip to content

Instantly share code, notes, and snippets.

@trnktms

trnktms/Initializer.cs

Last active Jan 31, 2019
Embed
What would you like to do?
public class Initializer
{
public static void Process(PipelineArgs args)
{
container = new Container();
container.Options.DefaultScopedLifestyle = new WebRequestLifestyle();
container.Register(typeof(ISitecoreContext), () => new SitecoreContext(), Lifestyle.Scoped);
DependencyResolver.SetResolver(
new ChainedDependencyResolver(
new SimpleInjectorDependencyResolver(container),
DependencyResolver.Current));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.