Exemplo n.º 1
0
        public CourseRepository()
        {
            //TODO: Antipattern
            var factory = new L2lDbContextFactory();

            db = factory.CreateDbContext(new string[] {});
        }
Exemplo n.º 2
0
        public CourseRepositoryTests()
        {
            var factory = new L2lDbContextFactory();
            var context = factory.CreateDbContext(new string[] {});

            context.Database.EnsureCreated();
        }
Exemplo n.º 3
0
        public DatabaseFixture()
        {
            factory = new L2lDbContextFactory();
            var db = GetNewDbContext();

            if (factory.IsInMemoryDb())
            {
                db.Database.EnsureCreated();
            }
            else
            {
                db.Database.Migrate();
            }
        }
Exemplo n.º 4
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();
            }
        }
Exemplo n.º 5
0
        public CourseRepository()
        {
            var factory = new L2lDbContextFactory();

            db = factory.CreateDbContext(new string[] {});
        }