public BuiltInDataTypesInMemoryFixture() { _testStore = new InMemoryTestStore(); var serviceProvider = new ServiceCollection() .AddEntityFrameworkInMemoryDatabase() .AddSingleton(TestInMemoryModelSource.GetFactory(OnModelCreating)) .BuildServiceProvider(); _options = new DbContextOptionsBuilder() .UseInMemoryDatabase() .UseInternalServiceProvider(serviceProvider) .Options; }
public override DbContext CreateContext(InMemoryTestStore testStore) => new StoreGeneratedFixupContext(new DbContextOptionsBuilder() .UseInMemoryDatabase() .UseInternalServiceProvider(_serviceProvider) .ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning)) .Options);
public override DbContext CreateContext(InMemoryTestStore testStore) => new GraphUpdatesContext(new DbContextOptionsBuilder() .UseInMemoryDatabase() .UseInternalServiceProvider(_serviceProvider).Options);
public override DbContext CreateContext(InMemoryTestStore testStore) => new FindContext(_options);
public override DbContext CreateContext(InMemoryTestStore testStore) => new AdvancedPatternsMasterContext(new DbContextOptionsBuilder() .UseInMemoryDatabase(DatabaseName) .UseInternalServiceProvider(_serviceProvider).Options);
public override InMemoryTestStore CreateTestStore() => InMemoryTestStore.GetOrCreateShared(DatabaseName, EnsureCreated);