fix
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
namespace MyOffice.Services.Account.Domain;
|
||||
/// <see cref="MyOffice.Data.Models.Items.Item"/>
|
||||
namespace MyOffice.Services.Account.Domain;
|
||||
|
||||
using AutoMapper;
|
||||
using MyOffice.Data.Models.Items;
|
||||
|
||||
public class ItemDto
|
||||
@@ -11,3 +13,15 @@ public class ItemDto
|
||||
public Guid CategoryId { get; set; }
|
||||
public ItemCategoryDto? Category { get; set; }
|
||||
}
|
||||
|
||||
public class ItemDtoProfile: Profile
|
||||
{
|
||||
public ItemDtoProfile()
|
||||
{
|
||||
CreateMap<Item, ItemDto>()
|
||||
.ForMember(x => x.Id, o => o.MapFrom(x => x.ItemGlobalId))
|
||||
.ForMember(x => x.Name, o => o.MapFrom(x => x.ItemGlobal.Name))
|
||||
.ForMember(x => x.AllowDelete, o => o.MapFrom(x => !x.Motions!.Any()))
|
||||
;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user