protected void Application_Start() { GlobalConfiguration.Configuration.DependencyResolver = new AutofacWebApiDependencyResolver( IoCConfig.Build(Assembly.GetExecutingAssembly())); GlobalConfiguration.Configure(WebApiConfig.Register); }
void Application_Start(object sender, EventArgs e) { IoCConfig.Build(); // Code that runs on application startup AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); RouteConfig.RegisterRoutes(RouteTable.Routes); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); DependencyResolver.SetResolver( new AutofacDependencyResolver( IoCConfig.Build(typeof(MvcApplication).Assembly, new ViewRegistrationSource()))); }