Exemplo n.º 1
0
        protected virtual TransportationContext CreateContext()
        {
            var options = AddOptions(TestStore.AddProviderOptions(new DbContextOptionsBuilder()))
                          .UseInternalServiceProvider(ServiceProvider).Options;

            return(new TransportationContext(options));
        }
Exemplo n.º 2
0
 public EmptyMigrationsContext CreateEmptyContext()
 => new EmptyMigrationsContext(
     TestStore.AddProviderOptions(
         new DbContextOptionsBuilder())
     .UseInternalServiceProvider(
         TestStoreFactory.AddProviderServices(
             new ServiceCollection())
         .BuildServiceProvider())
     .Options);
 private DbContextOptions <PersistedGrantDbContext> CreateOptions(TestStore testStore)
 => (DbContextOptions <PersistedGrantDbContext>)testStore
 .AddProviderOptions(new DbContextOptionsBuilder(new DbContextOptions <PersistedGrantDbContext>()))
 .EnableDetailedErrors()
 .EnableSensitiveDataLogging()
 .ConfigureWarnings(
     b => b.Default(WarningBehavior.Throw)
     .Log(CoreEventId.SensitiveDataLoggingEnabledWarning)
     .Log(CoreEventId.PossibleUnintendedReferenceComparisonWarning))
 .Options;
Exemplo n.º 4
0
 public DbContextOptions CreateOptions(TestStore testStore)
 => AddOptions(testStore.AddProviderOptions(new DbContextOptionsBuilder()))
 .EnableDetailedErrors()
 .UseInternalServiceProvider(ServiceProvider)
 .EnableServiceProviderCaching(false)
 .Options;
Exemplo n.º 5
0
 public DbContextOptions CreateOptions(TestStore testStore)
 => AddOptions(testStore.AddProviderOptions(new DbContextOptionsBuilder()))
 .UseInternalServiceProvider(testStore.ServiceProvider)
 .Options;
 public EmptyMigrationsContext CreateEmptyContext()
 => new EmptyMigrationsContext(TestStore.AddProviderOptions(new DbContextOptionsBuilder()).Options);
 public DbContextOptions CreateOptions(TestStore testStore)
 => AddOptions(testStore.AddProviderOptions(new DbContextOptionsBuilder()))
 .EnableRichDataErrorHandling()
 .UseInternalServiceProvider(ServiceProvider)
 .Options;