Exemplo n.º 1
0
        public DatabaseFixture()
        {
            factory = new L2lDbContextFactory();
            var db = GetNewDbContext();

            if (factory.IsInMemoryDb())
            {
                db.Database.EnsureCreated();
            }
            else
            {
                db.Database.Migrate();
            }
        }
Exemplo n.º 2
0
        public DatabaseFixture()
        {
            //AP
            factory = new L2lDbContextFactory();
            var db = GetNewL2lDbContext();

            if (factory.IsInMemoryDb())
            {
                //in memory db
                db.Database.EnsureCreated();
            }
            else
            {
                //working only in file db!!!!
                //https://github.com/aspnet/EntityFrameworkCore/issues/9842
                db.Database.Migrate();
            }
        }