public static IServiceCollection AddCloudscribeCoreEFStoragePostgreSql( this IServiceCollection services, string connectionString ) { services.AddCloudscribeCoreEFCommon(); services.AddEntityFrameworkNpgsql() .AddDbContext<CoreDbContext>((serviceProvider, options) => options.UseNpgsql(connectionString) .UseInternalServiceProvider(serviceProvider) ); services.AddScoped<ICoreDbContext, CoreDbContext>(); services.AddScoped<IDataPlatformInfo, DataPlatformInfo>(); return services; }
//public static IIdentityServerBuilder AddOperationalStoreMSSQL( // this IIdentityServerBuilder builder, // string connectionString, // Action<DbContextOptionsBuilder> optionsAction = null) //{ // builder.Services.AddEntityFrameworkNpgsql() // .AddDbContext<PersistedGrantDbContext>((serviceProvider, options) => // options.UseNpgsql(connectionString) // .UseInternalServiceProvider(serviceProvider) // ); // builder.Services.AddScoped<IPersistedGrantDbContext, PersistedGrantDbContext>(); // return builder; //} public static IServiceCollection AddCloudscribeCoreIdentityServerEFStoragePostgreSql( this IServiceCollection services, string connectionString ) { services.AddEntityFrameworkNpgsql() .AddDbContext<ConfigurationDbContext>((serviceProvider, options) => options.UseNpgsql(connectionString) .UseInternalServiceProvider(serviceProvider) ); services.AddCloudscribeCoreIdentityServerStores(); services.AddScoped<IConfigurationDbContext, ConfigurationDbContext>(); services.AddEntityFrameworkNpgsql() .AddDbContext<PersistedGrantDbContext>((serviceProvider, options) => options.UseNpgsql(connectionString) .UseInternalServiceProvider(serviceProvider) ); services.AddScoped<IPersistedGrantDbContext, PersistedGrantDbContext>(); return services; }