diff --git a/DigitalData.UserManager.API/DigitalData.UserManager.API.csproj b/DigitalData.UserManager.API/DigitalData.UserManager.API.csproj index fe63690..21e10fa 100644 --- a/DigitalData.UserManager.API/DigitalData.UserManager.API.csproj +++ b/DigitalData.UserManager.API/DigitalData.UserManager.API.csproj @@ -25,20 +25,15 @@ - all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - diff --git a/DigitalData.UserManager.API/Program.cs b/DigitalData.UserManager.API/Program.cs index fffd7f9..1ca735c 100644 --- a/DigitalData.UserManager.API/Program.cs +++ b/DigitalData.UserManager.API/Program.cs @@ -73,7 +73,7 @@ try { // Once the app is built, the password will be decrypted with Encryptor. lazy loading also acts as a call back method. Lazy? cnn_str = null; - builder.Services.AddDbContext(options => options.UseSqlServer(cnn_str!.Value).EnableSensitiveDataLogging()); + builder.Services.AddUserManager(options => options.UseSqlServer(cnn_str!.Value).EnableSensitiveDataLogging()); var allowedOrigins = builder.Configuration.GetSection("AllowedOrigins").Get() ?? throw new InvalidOperationException("In appsettings there is no allowed origin."); @@ -88,10 +88,7 @@ try { .AllowCredentials(); }); }); - - //builder.Services.AddAutoMapper(typeof(DirectoryMappingProfile).Assembly); - builder.Services.AddUserManager(); - + builder.ConfigureBySection(); builder.Services.AddDirectorySearchService(config.GetSection("DirectorySearchOptions")); builder.Services.AddJWTService(user => new SecurityTokenDescriptor() diff --git a/DigitalData.UserManager.DependencyInjection/Extensions.cs b/DigitalData.UserManager.DependencyInjection/Extensions.cs index f6b17d3..bfebd8b 100644 --- a/DigitalData.UserManager.DependencyInjection/Extensions.cs +++ b/DigitalData.UserManager.DependencyInjection/Extensions.cs @@ -22,12 +22,4 @@ public static class Extensions services.AddUserManagerApplication(); return services; } - - public static IServiceCollection AddUserManager(this IServiceCollection services, string connectionString) - where TDbContext : DbContext, IUserManagerDbContext - { - services.AddUserManagerInfrastructure(connectionString); - services.AddUserManagerApplication(); - return services; - } } diff --git a/DigitalData.UserManager.Infrastructure/DependencyInjection.cs b/DigitalData.UserManager.Infrastructure/DependencyInjection.cs index cbcf498..ea7a4f5 100644 --- a/DigitalData.UserManager.Infrastructure/DependencyInjection.cs +++ b/DigitalData.UserManager.Infrastructure/DependencyInjection.cs @@ -39,13 +39,4 @@ public static class DependencyInjection public static IServiceCollection AddUserManagerInfrastructure(this IServiceCollection services, Action optionsAction) => services .AddDbContext(optionsAction) .AddUserManagerInfrastructure(); - - /// - /// Adds the UserManager services and repositories to the specified . - /// This method registers the necessary mappings, repositories, services and for the UserManager. - /// - /// The IServiceCollection to which the services will be added. - /// The updated IServiceCollection. - public static IServiceCollection AddUserManagerInfrastructure(this IServiceCollection services, string connectionString) => services - .AddUserManagerInfrastructure(options => options.UseSqlServer(connectionString).EnableSensitiveDataLogging()); } diff --git a/DigitalData.UserManager.Infrastructure/DigitalData.UserManager.Infrastructure.csproj b/DigitalData.UserManager.Infrastructure/DigitalData.UserManager.Infrastructure.csproj index c539d87..f93db22 100644 --- a/DigitalData.UserManager.Infrastructure/DigitalData.UserManager.Infrastructure.csproj +++ b/DigitalData.UserManager.Infrastructure/DigitalData.UserManager.Infrastructure.csproj @@ -28,11 +28,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - -