public static void DbContextInit(HttpApplication httpApplication) { DbContextInitializer.Instance().InitializeDbContextOnce(() => DbContextManager.Init( DbContextCategory.MallDBContext.ToString(), new[] { "TMall.DomainModule.DBMapping.dll" }, new[] { "TMall.DomainModule.DBMapping.MainDB" }, false, true)); DbContextManager.InitStorage(new WebDbContextStorage(httpApplication)); }
protected void Application_BeginRequest(object sender, EventArgs e) { //Database.SetInitializer(new FlyingClub.Data.Model.NtxfcDbContextInitializer()); DbContextInitializer.Instance().InitializeObjectContextOnce(() => { DbContextManager.InitStorage(_objectContextStorage); //ObjectContextManager.Init("ntxfc_main", new[] { Server.MapPath("~/bin/FlyingClub.Data.Model.dll") }); DbContextManager.Init(new[] { Server.MapPath("~/bin/FlyingClub.Data.Model.dll") }); System.Diagnostics.Trace.WriteLine("BeginRequest: " + DbContextManager.Current.GetHashCode()); }); }