Füge DI-Erweiterungsmethode hinzu, um AutoMapper-Profile, Repositorys und Services für die UserManager-Anwendung zu konfigurieren.

This commit is contained in:
Developer 02
2024-06-13 12:53:12 +02:00
parent 42deb8a2f5
commit d2dc116cd0
3 changed files with 47 additions and 24 deletions

View File

@@ -1,9 +1,6 @@
using Microsoft.EntityFrameworkCore;
using DigitalData.UserManager.Application.MappingProfiles;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.Services;
using DigitalData.UserManager.Infrastructure.Repositories;
using DigitalData.UserManager.Infrastructure.Contracts;
using DigitalData.UserManager.Application;
using DigitalData.Core.Application;
using Microsoft.AspNetCore.Authentication.Cookies;
using NLog.Web;
@@ -59,27 +56,8 @@ try {
});
});
builder.Services.AddAutoMapper(typeof(UserMappingProfile).Assembly);
builder.Services.AddAutoMapper(typeof(GroupMappingProfile).Assembly);
builder.Services.AddAutoMapper(typeof(GroupOfUserMappingProfile).Assembly);
builder.Services.AddAutoMapper(typeof(ModuleMappingProfile).Assembly);
builder.Services.AddAutoMapper(typeof(ModuleOfUserMappingProfile).Assembly);
builder.Services.AddAutoMapper(typeof(UserRepMappingProfile).Assembly);
//builder.Services.AddAutoMapper(typeof(DirectoryMappingProfile).Assembly);
builder.Services.AddScoped<IUserRepository, UserRepository>();
builder.Services.AddScoped<IGroupRepository, GroupRepository>();
builder.Services.AddScoped<IGroupOfUserRepository, GroupOfUserRepository>();
builder.Services.AddScoped<IModuleRepository, ModuleRepository>();
builder.Services.AddScoped<IModuleOfUserRepository, ModuleOfUserRepository>();
builder.Services.AddScoped<IUserRepRepository, UserRepRepository>();
builder.Services.AddScoped<IUserService, UserService>();
builder.Services.AddScoped<IGroupService, GroupService>();
builder.Services.AddScoped<IGroupOfUserService, GroupOfUserService>();
builder.Services.AddScoped<IModuleService, ModuleService>();
builder.Services.AddScoped<IModuleOfUserService, ModuleOfUserService>();
builder.Services.AddScoped<IUserRepService, UserRepService>();
builder.Services.AddUserManager();
builder.Services.AddDirectorySearchService();