public static IServiceCollection AddAccountsHealthChecks( this IServiceCollection services, AccountsDatabaseConfiguration database, AccountsRabbitMqConfiguration rabbitMq) { services.AddHealthChecks() .AddNpgSql(database.ConnectionString) .AddRabbitMQ(rabbitMq.ConnectionString); return(services); }
public static IServiceCollection AddAccountsDatabase( this IServiceCollection services, AccountsDatabaseConfiguration configuration) { services.AddDbContextPool <AccountsContext>(options => options.UseNpgsql(configuration.ConnectionString, builder => builder.MigrationsHistoryTable(configuration.MigrationsTable)) .ConfigureWarnings(builder => builder.Throw(RelationalEventId.QueryClientEvaluationWarning))); return(services); }