Beispiel #1
0
        public static IServiceCollection AddProfilesDatabase(
            this IServiceCollection services,
            ProfilesDatabaseConfiguration configuration)
        {
            services.AddDbContextPool <ProfilesContext>(options =>
                                                        options.UseNpgsql(configuration.ConnectionString, builder =>
                                                                          builder.MigrationsHistoryTable(configuration.MigrationsTable))
                                                        .ConfigureWarnings(builder => builder.Throw(RelationalEventId.QueryClientEvaluationWarning)));

            return(services);
        }
Beispiel #2
0
        public static IServiceCollection AddProfilesHealthChecks(
            this IServiceCollection services,
            ProfilesDatabaseConfiguration database,
            ProfilesRabbitMqConfiguration rabbitMq)
        {
            services.AddHealthChecks()
            .AddNpgSql(database.ConnectionString)
            .AddRabbitMQ(rabbitMq.ConnectionString);

            return(services);
        }