public static void Initialize()
{
MvcBootstrapper mvcBootstrapper = new MvcBootstrapper(new ConventionalRegistrarConfig());
ApiBootstrapper apiBootstrapper = new ApiBootstrapper(mvcBootstrapper.IocManager);
apiBootstrapper.Initialize();
//依赖注入初始化
mvcBootstrapper.Initialize();
apiBootstrapper.Initialize();
mvcBootstrapper.IocManager.Register<ISignInManager, IdentitySignInManager>(DependencyLifeStyle.Transient);
}
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); LogConfig.Initialize(); ILogger logger = LogManager.GetLogger(typeof(MvcApplication)); logger.Debug("网站启动"); CastleConfig.Initialize(); logger.Debug("依赖注入初始化完成"); DatabaseConfig.Initialize(); logger.Debug("数据库初始化完成"); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); }