feat(DIExtensions): AddUserManager hinzugefügt, um mit db-Kontext hinzuzufügen

This commit is contained in:
Developer 02 2025-01-15 12:45:59 +01:00
parent fbf9bbeba0
commit 33326866f9
2 changed files with 16 additions and 6 deletions

View File

@ -44,6 +44,16 @@ namespace DigitalData.UserManager.Application
.AddScoped<IModuleOfUserService, ModuleOfUserService>()
.AddScoped<IUserRepService, UserRepService>();
/// <summary>
/// Adds the UserManager services and repositories to the specified <see cref="IServiceCollection"/>.
/// This method registers the necessary mappings, repositories, services and <see cref="UserManagerDbContext"/> for the UserManager.
/// </summary>
/// <param name="services">The IServiceCollection to which the services will be added.</param>
/// <returns>The updated IServiceCollection.</returns>
public static IServiceCollection AddUserManager(this IServiceCollection services, string connectionString)=> services
.AddDbContext<UserManagerDbContext>(options => options.UseSqlServer(connectionString).EnableSensitiveDataLogging())
.AddUserManager<UserManagerDbContext>();
public static IServiceCollection AddEncryptor(this IServiceCollection services, IConfiguration configuration)
{
services.AddSingleton<Encryptor>();

View File

@ -17,16 +17,16 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BC8CEADC-F7D6-4469-8718-4B308C386B4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BC8CEADC-F7D6-4469-8718-4B308C386B4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC8CEADC-F7D6-4469-8718-4B308C386B4D}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{BC8CEADC-F7D6-4469-8718-4B308C386B4D}.Debug|Any CPU.Build.0 = Release|Any CPU
{BC8CEADC-F7D6-4469-8718-4B308C386B4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC8CEADC-F7D6-4469-8718-4B308C386B4D}.Release|Any CPU.Build.0 = Release|Any CPU
{0634853C-C515-48AF-8E27-E5CBF592BCE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0634853C-C515-48AF-8E27-E5CBF592BCE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0634853C-C515-48AF-8E27-E5CBF592BCE7}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{0634853C-C515-48AF-8E27-E5CBF592BCE7}.Debug|Any CPU.Build.0 = Release|Any CPU
{0634853C-C515-48AF-8E27-E5CBF592BCE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0634853C-C515-48AF-8E27-E5CBF592BCE7}.Release|Any CPU.Build.0 = Release|Any CPU
{1DD81373-82F9-4872-95C6-888624DB1797}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1DD81373-82F9-4872-95C6-888624DB1797}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1DD81373-82F9-4872-95C6-888624DB1797}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{1DD81373-82F9-4872-95C6-888624DB1797}.Debug|Any CPU.Build.0 = Release|Any CPU
{1DD81373-82F9-4872-95C6-888624DB1797}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1DD81373-82F9-4872-95C6-888624DB1797}.Release|Any CPU.Build.0 = Release|Any CPU
{07CCD651-647C-49F7-9715-30CEBC13710D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU