using Knot.Contracts.Auth.Application.Abstractions; using Knot.Contracts.Auth.Domain; using Knot.Contracts.Auth.Infrastructure.Persistence; using Knot.Modules.Auth.Infrastructure.Authentication; using Knot.Modules.Auth.Infrastructure.Persistence; using Knot.Shared.Kernel; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; namespace Knot.Modules.Auth; public static class DependencyInjection { public static IServiceCollection AddAuthModule( this IServiceCollection services, IConfiguration configuration) { string connectionString = configuration.GetConnectionString("DefaultConnection")!; services.AddDbContext(options => options.UseNpgsql(connectionString)); services.AddScoped(sp => sp.GetRequiredService()); services.AddScoped(sp => sp.GetRequiredService()); services.AddScoped(sp => sp.GetRequiredService()); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddMediatR(config => config.RegisterServicesFromAssembly(typeof(DependencyInjection).Assembly)); return services; } }