Skip to content

Instantly share code, notes, and snippets.

@trnktms
Last active January 31, 2019 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trnktms/dd2b638acb181103f328b9af4d60334f to your computer and use it in GitHub Desktop.
Save trnktms/dd2b638acb181103f328b9af4d60334f to your computer and use it in GitHub Desktop.
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