Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public static IServiceCollection AddProfilesHealthChecks(
            this IServiceCollection services,
            ProfilesDatabaseConfiguration database,
            ProfilesRabbitMqConfiguration rabbitMq)
        {
            services.AddHealthChecks()
            .AddNpgSql(database.ConnectionString)
            .AddRabbitMQ(rabbitMq.ConnectionString);

            return(services);
        }