using DigitalData.UserManager.Application.Contracts.Repositories; using DigitalData.UserManager.Infrastructure.Contracts; using DigitalData.UserManager.Infrastructure.Repositories; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; namespace DigitalData.UserManager.Infrastructure; public static class DependencyInjection { /// /// Adds the UserManager repositories to the specified . /// This method registers the necessary repositories for the UserManager. /// /// The type of the DbContext to use for the repositories. /// The IServiceCollection to which the services will be added. /// The updated IServiceCollection. [Obsolete("Use IRepository")] public static IServiceCollection AddUserManagerInfrastructure(this IServiceCollection services) where TDbContext : DbContext, IUserManagerDbContext { return services .AddScoped>() .AddScoped>() .AddScoped>() .AddScoped>() .AddScoped>() .AddScoped>() .AddScoped>(); } /// /// Adds the UserManager services and repositories to the specified . /// This method allows configuring the DbContext options using the provided . /// /// The to which the services will be added. /// An to configure the . /// The updated . [Obsolete("Use IRepository")] public static IServiceCollection AddUserManagerInfrastructure(this IServiceCollection services, Action optionsAction) => services .AddDbContext(optionsAction) .AddUserManagerInfrastructure(); }