protected void Application_Start() { AutoFacConfig.Configure(); AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); }
public void Configuration(IAppBuilder app) { app.UseWelcomePage("/"); var config = new HttpConfiguration(); app.UseCors(CorsOptions.AllowAll); ConfigureWebApi(config); app.UseWebApi(config); AutoFacConfig.Configure(); }
// This method gets called by the runtime. Use this method to add services to the container. public IServiceProvider ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1) .AddFluentValidation(); services.AddDbContext <DataContext>(options => options.UseSqlServer(Configuration.GetConnectionString("Default"))); var applicationContainer = AutoFacConfig.Configure(services); return(new AutofacServiceProvider(applicationContainer)); }
protected void Application_Start() { GlobalConfiguration.Configure(WebApiConfig.Register); AutoFacConfig.Configure(); AutoMapperConfig.Configure(); }
protected void Application_Start(object sender, EventArgs e) { AutoFacConfig.Configure(); }