fix
This commit is contained in:
@@ -30,29 +30,8 @@ public class AccountServiceProfile : Profile
|
||||
|
||||
private void MapAccount()
|
||||
{
|
||||
CreateMap<Account, AccountDto>()
|
||||
.ForMember(x => x.HasMotions, o => o.MapFrom(x => x.Motions!.Any()))
|
||||
.ForMember(x => x.CurrentUserId, o => o.MapFrom<UserIdResolver>())
|
||||
.ForMember(x => x.AccountAccess, o =>
|
||||
{
|
||||
o.MapFrom((src, dst) => src.AccessRights!.FirstOrDefault(x => x.UserId == dst.CurrentUserId));
|
||||
})
|
||||
.ForMember(x => x.Type, o =>
|
||||
{
|
||||
o.SetMappingOrder(1);
|
||||
o.MapFrom((src, dst) => dst.AccountAccess?.Type.ToString());
|
||||
})
|
||||
.ForMember(x => x.Name, o =>
|
||||
{
|
||||
o.SetMappingOrder(1);
|
||||
o.MapFrom((src, dst) => dst.AccountAccess?.Name ?? src.Name);
|
||||
})
|
||||
;
|
||||
|
||||
CreateMap<AccountDetailed, AccountDetailedDto>();
|
||||
|
||||
CreateMap<AccountAccess, AccountAccessDto>();
|
||||
|
||||
CreateMap<AccountAccountCategory, AccountAccountCategoryDto>();
|
||||
|
||||
CreateMap<AccountCategory, AccountCategoryDto>()
|
||||
|
||||
Reference in New Issue
Block a user