public override SqlServerTestStore CreateTestStore() { return(SqlServerTestStore.GetOrCreateShared(DatabaseName, () => { var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseSqlServer(SqlServerTestStore.CreateConnectionString(DatabaseName)); using (var context = new StoreGeneratedContext(_serviceProvider, optionsBuilder.Options)) { context.Database.EnsureDeleted(); context.Database.EnsureCreated(); } })); }
public SqlServerNullKeysFixture() { _serviceProvider = new ServiceCollection() .AddEntityFramework() .AddSqlServer() .ServiceCollection .AddTestModelSource(OnModelCreating) .BuildServiceProvider(); _options = new DbContextOptions(); _options.UseSqlServer(SqlServerTestStore.CreateConnectionString("StringsContext")); EnsureCreated(); }
public NullKeysSqlServerFixture() { _serviceProvider = new ServiceCollection() .AddEntityFramework() .AddSqlServer() .ServiceCollection() .AddSingleton(TestSqlServerModelSource.GetFactory(OnModelCreating)) .BuildServiceProvider(); var optionsBuilder = new DbContextOptionsBuilder(); optionsBuilder.UseSqlServer(SqlServerTestStore.CreateConnectionString("StringsContext")); _options = optionsBuilder.Options; EnsureCreated(); }
public override SqlServerTestStore CreateTestStore() { return(SqlServerTestStore.GetOrCreateShared(DatabaseName, () => { var optionsBuilder = new EntityOptionsBuilder(); optionsBuilder.UseSqlServer(SqlServerTestStore.CreateConnectionString(DatabaseName)); using (var context = new GraphUpdatesContext(_serviceProvider, optionsBuilder.Options)) { context.Database.EnsureDeleted(); if (context.Database.EnsureCreated()) { Seed(context); } } })); }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlServer(SqlServerTestStore.CreateConnectionString(_databaseName)); }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder.UseSqlServer(SqlServerTestStore.CreateConnectionString("Repro963"));
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder .EnableSensitiveDataLogging() .UseSqlServer(SqlServerTestStore.CreateConnectionString("Repro925"));
protected override void OnConfiguring(DbContextOptions options) { options.UseSqlServer(SqlServerTestStore.CreateConnectionString("Repro603")); }
protected override void OnConfiguring(EntityOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlServer(SqlServerTestStore.CreateConnectionString("Repro963")); }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { var name = GetType().FullName.Substring((GetType().Namespace + nameof(SqlServerValueGenerationScenariosTest)).Length + 2); optionsBuilder.UseSqlServer(SqlServerTestStore.CreateConnectionString(name)); }
protected override void OnConfiguring(DbContextOptions options) { options.UseSqlServer(SqlServerTestStore.CreateConnectionString(_databaseName)); base.OnConfiguring(options); }