public CourseRepository() { //TODO: Antipattern var factory = new L2lDbContextFactory(); db = factory.CreateDbContext(new string[] {}); }
public CourseRepositoryTests() { var factory = new L2lDbContextFactory(); var context = factory.CreateDbContext(new string[] {}); context.Database.EnsureCreated(); }
public DatabaseFixture() { factory = new L2lDbContextFactory(); var db = GetNewDbContext(); if (factory.IsInMemoryDb()) { db.Database.EnsureCreated(); } else { db.Database.Migrate(); } }
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(); } }
public CourseRepository() { var factory = new L2lDbContextFactory(); db = factory.CreateDbContext(new string[] {}); }