public static IServiceCollection AddMangasHealthChecks(
            this IServiceCollection services,
            MangasDatabaseConfiguration database,
            MangasRabbitMqConfiguration rabbitMq)
        {
            services.AddHealthChecks()
            .AddNpgSql(database.ConnectionString)
            .AddRabbitMQ(rabbitMq.ConnectionString);

            return(services);
        }
예제 #2
0
        public static IServiceCollection AddMangasDatabase(
            this IServiceCollection services,
            MangasDatabaseConfiguration configuration)
        {
            services.AddDbContextPool <MangasContext>(options =>
                                                      options.UseNpgsql(configuration.ConnectionString, builder =>
                                                                        builder.MigrationsHistoryTable(configuration.MigrationsTable))
                                                      .ConfigureWarnings(builder => builder.Throw(RelationalEventId.QueryClientEvaluationWarning)));

            return(services);
        }