    using Microsoft.EntityFrameworkCore;
using Netdev.DataAccess.DbContexts;
using Netdev.DataAccess.Interfaces;
using Netdev.DataAccess.Repositories;

namespace Netdev.Api.Configurations.LayerConfigurations
{
    public static class DataAccessConfiguration
    {
        public static void ConfigureDataAccess(this WebApplicationBuilder builder)
        {
            string connectionString = builder.Configuration.GetConnectionString("DatabaseConnection")!;
            builder.Services.AddDbContext<AppDbContext>(options => options.UseNpgsql(connectionString));
            builder.Services.AddScoped<IUnitOfWork, UnitOfWork>();
        }
    }
}
