Files
myoffice/MyOffice.Web/Models/Item/ItemCategoryViewModel.cs
T
2023-07-31 08:50:05 +03:00

33 lines
688 B
C#

namespace MyOffice.Web.Models.Item
{
using System.ComponentModel.DataAnnotations;
using Services.Account.Domain;
public class ItemCategoryViewModel
{
public string? Id { get; set; }
[Required]
public string Name { get; set; } = null!;
public bool AllowDelete { get; set; }
public int SortOrder { get; set; }
public bool Internal { get; set; }
}
public static class ItemCategoryViewModelExtensions
{
public static ItemCategoryDto FromModel(this ItemCategoryViewModel input)
{
if (input == null)
throw new ArgumentNullException(nameof(input));
return new ItemCategoryDto
{
Name = input.Name,
IsInternal = input.Internal,
};
}
}
}