This commit is contained in:
2023-12-16 21:18:01 +02:00
parent 775146ee86
commit 2feaf50802
46 changed files with 641 additions and 429 deletions
+15 -1
View File
@@ -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()))
;
}
}