Пример #1
0
 public TestStore CreateTestStore(ITestStoreFactory testStoreFactory)
 {
     return(testStoreFactory.GetOrCreate(StoreName)
            .Initialize(
                AddServices(testStoreFactory.AddProviderServices(new ServiceCollection()))
                .BuildServiceProvider(validateScopes: true), CreateContext, c => { }, null));
 }
Пример #2
0
 public static ITestStoreFactory EnsureInitialized(
     ref ITestStoreFactory inst,
     InfoCarrierBackendTestStoreFactory backendTestStoreFactory,
     Type contextType,
     Action <ModelBuilder, DbContext> onModelCreating,
     Func <DbContextOptionsBuilder, DbContextOptionsBuilder> onAddOptions = null,
     Action <DbContext, DbContext> copyDbContextParameters = null)
 => NonCapturingLazyInitializer.EnsureInitialized(
     ref inst,
     inst,
     _ => new InfoCarrierTestStoreFactory(
         new SharedTestStoreProperties
 {
     ContextType             = contextType,
     OnModelCreating         = onModelCreating,
     OnAddOptions            = onAddOptions ?? (o => o),
     CopyDbContextParameters = copyDbContextParameters,
 },
         backendTestStoreFactory));
 public TestStore CreateTestStore(ITestStoreFactory testStoreFactory, string storeName, Action <CrossStoreContext> seed = null)
 => testStoreFactory.GetOrCreate(storeName)
 .Initialize(
     AddServices(testStoreFactory.AddProviderServices(new ServiceCollection())).BuildServiceProvider(validateScopes: true),
     CreateContext,
     seed);