Files
myoffice/MyOffice.Services/Account/AccountServiceProfile.cs
T
2023-07-25 22:10:03 +03:00

30 lines
802 B
C#

using MyOffice.Services.Account.Domain;
namespace MyOffice.Services.Account;
using AutoMapper;
using Data.Models.Accounts;
using Data.Models.Users;
public class AccountServiceProfile : Profile
{
public AccountServiceProfile()
{
CreateMap<User, UserDto>();
CreateMap<Account, AccountDto>()
.ForMember(x => x.HasMotions, o => o.MapFrom(x => x.Motions.Any()))
;
CreateMap<AccountDetailed, AccountDetailedDto>();
CreateMap<AccountAccess, AccountAccessDto>();
CreateMap<AccountAccountCategory, AccountAccountCategoryDto>();
CreateMap<AccountCategory, AccountCategoryDto>()
.ForMember(x => x.Id, o => o.MapFrom(x => x.Id))
.ForMember(x => x.Id, o => o.MapFrom(x => x.Id))
;
}
}