示例#1
0
        public static IServiceCollection AddAccountsHealthChecks(
            this IServiceCollection services,
            AccountsDatabaseConfiguration database,
            AccountsRabbitMqConfiguration rabbitMq)
        {
            services.AddHealthChecks()
            .AddNpgSql(database.ConnectionString)
            .AddRabbitMQ(rabbitMq.ConnectionString);

            return(services);
        }
示例#2
0
        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);
        }