Created
December 29, 2015 12:13
-
-
Save sshibani/fd9f357602c09896038a to your computer and use it in GitHub Desktop.
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
public class MvcApplication : System.Web.HttpApplication | |
{ | |
ILifetimeScope BuildContainer() | |
{ | |
var builder = new ContainerBuilder(); | |
builder.RegisterControllers(typeof(MvcApplication).Assembly); | |
builder.UseDD4T(); | |
return builder.Build(); | |
} | |
protected void Application_Start() | |
{ | |
var builder = BuildContainer(); | |
DependencyResolver.SetResolver(new AutofacDependencyResolver(builder)); | |
AreaRegistration.RegisterAllAreas(); | |
RouteConfig.RegisterRoutes(RouteTable.Routes); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment