Exemplo n.º 1
0
 public static void ConfigureInMemory(this IServiceCollection services, int poolSize, HealthChecksUIBuilder healthChecksUI)
 {
     services.AddEntityFrameworkInMemoryDatabase();
     services.AddSingleton <IDataBaseModelBuilderOptions>(c => new InMemoryModelBuilderOptions());
     services.AddDbContextPool <ApplicationDbContext>(builder =>
     {
         builder.UseInMemoryDatabase("IoTSharp");
         builder.UseInternalServiceProvider(services.BuildServiceProvider());
     }, poolSize);
     healthChecksUI.AddInMemoryStorage();
 }
 public static void ConfigureOracle(this IServiceCollection services, string connectionString, int poolSize, IHealthChecksBuilder checksBuilder, HealthChecksUIBuilder healthChecksUI)
 {
     services.AddEntityFrameworkOracle();
     services.AddSingleton <IDataBaseModelBuilderOptions>(c => new OracleModelBuilderOptions());
     services.AddDbContextPool <ApplicationDbContext>(builder =>
     {
         builder.UseOracle(connectionString, s => s.MigrationsAssembly("IoTSharp.Data.Oracle"));
         builder.UseInternalServiceProvider(services.BuildServiceProvider());
     }
                                                      , poolSize);
     checksBuilder.AddOracle(connectionString, name: "IoTSharp.Data.Oracle");
     healthChecksUI.AddInMemoryStorage();
 }