Structurare backend

This commit is contained in:
andrei-mihnea-cerbu
2024-04-04 15:11:30 +03:00
parent 4d0636f011
commit d43beb66b6
87 changed files with 6272 additions and 0 deletions
@@ -0,0 +1,27 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Infrastructure.Data;
using Application.Contracts.Interfaces;
using Infrastructure.Repositories;
namespace Infrastructure
{
public static class DependencyInjection
{
public static IServiceCollection AddInfrastructureServices(this IServiceCollection services, IConfiguration configuration)
{
services.AddDbContext<HealthcareManagerContext>(options =>
options.UseNpgsql(configuration.GetConnectionString("HealthcareManagerDatabase")));
services.AddScoped<IPacientRepository, PacientRepository>();
services.AddScoped<IDoctorRepository, DoctorRepository>();
services.AddScoped<IMedicalHistoryRepository, MedicalHistoryRepository>();
// services.AddScoped<IEmailService, EmailService>();
return services;
}
}
}