wsd_djy/WebSiteCode/Cmdjy/CmdjyHisFront/Global.asax.cs

28 lines
912 B
C#

using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Autofac.Integration.Mvc;
using CmdjyHisFront.Dal;
namespace CmdjyHisFront
{
public class MvcApplication:System.Web.HttpApplication
{
protected void Application_Start() {
Database.SetInitializer(new MigrateDatabaseToLatestVersion<HisFrontDbContext,DbConfig>());
//配置autofac依赖注入
DependencyResolver.SetResolver(new AutofacDependencyResolver(IocFactory.Factory));
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}