- Added obsolete attributes to `AuthController`, `ModuleController`, and various mapping profiles, recommending the use of MediatR and DigitalData.Core.Exceptions. - Updated `User` class to use `required` keyword for `DateFormat` in .NET 7.0 or greater. - Marked methods in `Extensions` and `AddUserManagerInfrastructure` as obsolete, suggesting the use of IRepository. - Adjusted import statements in `DependencyInjection.cs` and marked `GroupOfUserRepository` and `ModuleRepository` as obsolete, recommending a Repository pattern.
28 lines
1.2 KiB
C#
28 lines
1.2 KiB
C#
using AutoMapper;
|
|
using DigitalData.UserManager.Application.DTOs.Group;
|
|
using DigitalData.UserManager.Domain.Entities;
|
|
|
|
namespace DigitalData.UserManager.Application.MappingProfiles
|
|
{
|
|
public class GroupMappingProfile : Profile
|
|
{
|
|
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
|
public GroupMappingProfile()
|
|
{
|
|
CreateMap<Group, GroupCreateDto>();
|
|
CreateMap<Group, GroupReadDto>();
|
|
CreateMap<Group, GroupUpdateDto>();
|
|
|
|
CreateMap<GroupCreateDto, Group>();
|
|
CreateMap<GroupReadDto, Group>();
|
|
CreateMap<GroupUpdateDto, Group>();
|
|
|
|
CreateMap<DirectoryGroupDto, Group>()
|
|
.ForMember(group => group.EcmFkId, opt => opt.MapFrom(adGroup => 1))
|
|
.ForMember(group => group.AdSync, opt => opt.MapFrom(adGroup => true))
|
|
.ForMember(group => group.Internal, opt => opt.MapFrom(adGroup => false))
|
|
.ForMember(group => group.Active, opt => opt.MapFrom(adGroup => true))
|
|
.ForMember(group => group.Name, opt => opt.MapFrom(adGroup => adGroup.Samaccountname.ElementAt(0)));
|
|
}
|
|
}
|
|
} |