예제 #1
0
 protected void Application_Start()
 {
     AutoFacConfig.Configure();
     AreaRegistration.RegisterAllAreas();
     GlobalConfiguration.Configure(WebApiConfig.Register);
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
 }
예제 #2
0
파일: Startup.cs 프로젝트: narekye/code
        public void Configuration(IAppBuilder app)
        {
            app.UseWelcomePage("/");
            var config = new HttpConfiguration();

            app.UseCors(CorsOptions.AllowAll);
            ConfigureWebApi(config);
            app.UseWebApi(config);
            AutoFacConfig.Configure();
        }
예제 #3
0
        // 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));
        }
예제 #4
0
 protected void Application_Start()
 {
     GlobalConfiguration.Configure(WebApiConfig.Register);
     AutoFacConfig.Configure();
     AutoMapperConfig.Configure();
 }
예제 #5
0
 protected void Application_Start(object sender, EventArgs e)
 {
     AutoFacConfig.Configure();
 }