using Application.Services.Database; using Application.Services.HashingAlgorithms; using Infrastructure.Data; using Infrastructure.Services.HashingAlgorithms; using Infrastructure.Services.MongoDB; using Infrastructure.Services.PostgreSQL; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; namespace Infrastructure; public static class DependencyInjection { public static IServiceCollection AddInfrastructureServices(this IServiceCollection services, IConfiguration configuration) { services.AddDbContext(options => options.UseNpgsql(configuration.GetConnectionString("HealthcareManagerDatabase"))); //PostgreSQL Services services.AddScoped(); services.AddScoped(); services.AddScoped(); // MongoDB Service var mongoDbConnection = configuration.GetConnectionString("MongoDBDatabase"); services.AddSingleton(serviceProvider => new MongoDbService(mongoDbConnection)); // Other Services services.AddScoped(); // services.AddScoped(); return services; } }