using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using StellaOps.Concelier.Storage.Postgres.Repositories; using StellaOps.Infrastructure.Postgres; using StellaOps.Infrastructure.Postgres.Options; namespace StellaOps.Concelier.Storage.Postgres; /// /// Extension methods for configuring Concelier PostgreSQL storage services. /// public static class ServiceCollectionExtensions { /// /// Adds Concelier PostgreSQL storage services. /// /// Service collection. /// Configuration root. /// Configuration section name for PostgreSQL options. /// Service collection for chaining. public static IServiceCollection AddConcelierPostgresStorage( this IServiceCollection services, IConfiguration configuration, string sectionName = "Postgres:Concelier") { services.Configure(sectionName, configuration.GetSection(sectionName)); services.AddSingleton(); // Register repositories services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); return services; } /// /// Adds Concelier PostgreSQL storage services with explicit options. /// /// Service collection. /// Options configuration action. /// Service collection for chaining. public static IServiceCollection AddConcelierPostgresStorage( this IServiceCollection services, Action configureOptions) { services.Configure(configureOptions); services.AddSingleton(); // Register repositories services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); return services; } }