public MainDatabase CreateDbContext() { var builder = new DbContextOptionsBuilder <MainDatabase>(); builder.UseSqlite(this.connection); var context = new TestMainDatabase(builder.Options); try { context.Database.EnsureCreated(); } catch { context.Dispose(); throw; } return(context); }
public MainDatabase CreateDbContext() { var builder = new DbContextOptionsBuilder <MainDatabase>(); builder.EnableDetailedErrors(); builder.EnableSensitiveDataLogging(); builder.UseSqlite(this.connection); builder.UseLoggerFactory(this.logger); var context = new TestMainDatabase(builder.Options); try { context.Database.EnsureCreated(); } catch { context.Dispose(); throw; } return(context); }