public void SetUp()
        {
            DbContextManager.InitStorage(new SimpleDbContextStorage());
            DbContextManager.Init("DefaultDb", new[] { "Infrastructure.Tests" }, true);

            customerRepository = new Infrastructure.Tests.Data.Lab.CustomerRepository();
            repository         = new Infrastructure.Data.EntityFramework.Lab.GenericRepository();
        }
Example #2
0
        public void SetUp()
        {
            DbContextManager.InitStorage(new SimpleDbContextStorage());
            DbContextManager.Init("DefaultDb", new[] { "Infrastructure.Tests" }, true);

            customerRepository = new CustomerRepository();
            repository         = new GenericRepository();
        }
        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));
        }
Example #4
0
        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());
            });
        }