public override InMemoryTestStore CreateTestStore() => InMemoryTestStore.GetOrCreateShared(DatabaseName, () => { using (var context = new DataAnnotationContext(_options)) { DataAnnotationModelInitializer.Seed(context); } });
public override SqliteTestStore CreateTestStore() => SqliteTestStore.GetOrCreateShared(DatabaseName, () => { var optionsBuilder = new DbContextOptionsBuilder(_options) .UseSqlite(_connectionString); using (var context = new DataAnnotationContext(optionsBuilder.Options)) { context.Database.EnsureClean(); DataAnnotationModelInitializer.Seed(context); } });
public override SqlServerTestStore CreateTestStore() => SqlServerTestStore.GetOrCreateShared(DatabaseName, () => { var options = new DbContextOptionsBuilder(_options) .UseSqlServer(_connectionString, b => b.ApplyConfiguration()) .Options; using (var context = new DataAnnotationContext(options)) { context.Database.EnsureCreated(); DataAnnotationModelInitializer.Seed(context); } });