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
@@ -1,10 +1,9 @@
namespace MyOffice.Web.Models.Account;
using MyOffice.Core.Attributes;
using MyOffice.Services.Account.Domain;
using System.ComponentModel.DataAnnotations;
using AutoMapper;
using MyOffice.Services.Account.Domain;
[Link(typeof(AccountCategoryDto))]
public class AccountCategoryViewModel: IResponseModel
{
public string? Id { get; set; }
@@ -13,4 +12,19 @@ public class AccountCategoryViewModel: IResponseModel
public string? Name { get; set; }
public bool? AllowDelete { get; set; }
}
public class AccountCategoryViewModelProfile: Profile
{
public AccountCategoryViewModelProfile()
{
CreateMap<AccountAccountCategoryDto, AccountCategoryViewModel>()
.ForMember(x => x.Id, o => o.MapFrom(x => x.CategoryId))
.ForMember(x => x.Name, o => o.MapFrom(x => x.Category!.Name))
;
CreateMap<AccountCategoryDto, AccountCategoryViewModel>()
.ForMember(x => x.Id, o => o.MapFrom(x => x.Id))
.ForMember(x => x.Name, o => o.MapFrom(x => x.Name))
;
}
}