using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.MappingProfiles;
using DigitalData.UserManager.Application.Services;
using DigitalData.UserManager.Application.Services.Options;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace DigitalData.UserManager.Application
{
public static class DIExtensions
{
///
/// Adds the UserManager services and repositories to the specified .
/// This method registers the necessary mappings, repositories, and services 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 MediatR")]
public static IServiceCollection AddUserManagerApplication(this IServiceCollection services)
=> services
.AddAutoMapper(typeof(UserMappingProfile).Assembly)
.AddAutoMapper(typeof(GroupMappingProfile).Assembly)
.AddAutoMapper(typeof(GroupOfUserMappingProfile).Assembly)
.AddAutoMapper(typeof(ModuleMappingProfile).Assembly)
.AddAutoMapper(typeof(ModuleOfUserMappingProfile).Assembly)
.AddAutoMapper(typeof(UserRepMappingProfile).Assembly)
.AddScoped()
.AddScoped()
.AddScoped()
.AddScoped()
.AddScoped()
.AddScoped();
public static IServiceCollection AddEncryptor(this IServiceCollection services, IConfiguration configuration)
{
services.AddSingleton();
services.Configure(configuration);
return services;
}
}
}