Skip to content

Instantly share code, notes, and snippets.

@sshibani
Last active October 30, 2015 13:28
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 sshibani/07500509ee57ef4299de to your computer and use it in GitHub Desktop.
Save sshibani/07500509ee57ef4299de to your computer and use it in GitHub Desktop.
Globals.asax snippet
ILifetimeScope BuildContainer()
{
var builder = new ContainerBuilder();
builder.RegisterType<HttpClientAuthentication>()
.As<DD4T.Providers.Rest.IHttpMessageHandlerFactory>();
builder.UseDD4T();
}
protected void Application_Start()
{
var container = BuildContainer();
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment