using System.ComponentModel.DataAnnotations; using AutoMapper.Configuration.Annotations; using VberZero.AppService.Base.Dto; using VberZero.BaseSystem.Roles; namespace VberZero.AppService.Roles.Dto; public class RoleDto : VzEntityDto { public RoleDto(Role role, bool isCheck = false) { Id = role.Id; Name = role.Name; DisplayName = role.DisplayName; NormalizedName = role.NormalizedName; Description = role.Description; UserType = role.UserType; AccountType = role.AccountType; IsCheck = isCheck; } public RoleDto() { } [Required] [StringLength(Role.MaxNameLength)] public string Name { get; set; } [Required] [StringLength(Role.MaxDisplayNameLength)] public string DisplayName { get; set; } public string NormalizedName { get; set; } [StringLength(Role.MaxDescriptionLength)] public string Description { get; set; } public VzDefinition.UserType UserType { get; set; } public VzDefinition.AccountType AccountType { get; set; } [Ignore] public bool IsCheck { get; set; } public List GrantedPermissions { get; set; } }