33 lines
688 B
C#
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,
|
|
};
|
|
}
|
|
}
|
|
}
|