using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Persistence.Repositories; using Persistence.Database.Model; using Persistence.Repository.Data; using Persistence.Repository.Repositories; namespace Persistence.Repository; public static class DependencyInjection { public static void MapsterSetup() { } public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration) { MapsterSetup(); string connectionStringName = "DefaultConnection"; services.AddDbContext(options => options.UseNpgsql(configuration.GetConnectionString(connectionStringName))); services.AddScoped(provider => provider.GetRequiredService()); services.AddTransient, TimeSeriesDataRepository>(); services.AddTransient(); return services; } }