fix
This commit is contained in:
@@ -1,29 +1,16 @@
|
||||
namespace MyOffice.Web.Models.Account
|
||||
namespace MyOffice.Web.Models.Account;
|
||||
|
||||
using MyOffice.Core.Attributes;
|
||||
using MyOffice.Services.Account.Domain;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
[Link(typeof(AccountCategoryDto))]
|
||||
public class AccountCategoryViewModel
|
||||
{
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Core.Extensions;
|
||||
using Data.Models.Accounts;
|
||||
public string? Id { get; set; }
|
||||
|
||||
public class AccountCategoryViewModel
|
||||
{
|
||||
public string? Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public string? Name { get; set; }
|
||||
[Required]
|
||||
public string? Name { get; set; }
|
||||
|
||||
public bool? AllowDelete { get; set; }
|
||||
}
|
||||
|
||||
public static class AccountCategoryViewModelExtensions
|
||||
{
|
||||
public static AccountCategoryViewModel ToModel(this AccountCategory input)
|
||||
{
|
||||
return new AccountCategoryViewModel
|
||||
{
|
||||
Id = input.Id.ToShort(),
|
||||
Name = input.Name,
|
||||
AllowDelete = !input.Accounts?.Any(),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool? AllowDelete { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user