using SqlSugar; using System; using System.ComponentModel.DataAnnotations; using WoodWood.Util.Validations; namespace Wood.Entity.SystemManage { /// /// 字典详细信息 /// [SugarTable("SysDataDictDetail", "字典详细信息")] [SugarIndex("SysDataDictDetail_DictKey", nameof(DictKey), OrderByType.Desc, true)] public class DataDictDetailEntity : EntityBaseExtra { /// /// 字典类型 /// [SugarColumn(ColumnDescription = "字典类型")] [Required] public long DictTypeId { get; set; } /// /// 字典键 /// /// [SugarColumn(ColumnDescription = "字典键", Length = 32)] [Required] [UniqueValue(ErrorMessage ="字典Key不能重复!")] public string DictKey { get; set; } = ""; /// /// 字典值 /// /// [SugarColumn(ColumnDescription = "字典值", Length = 32)] [Required] public string DictValue { get; set; } = ""; /// /// 排序 /// [SugarColumn(ColumnDescription = "排序")] public int Sort { get; set; } = 0; /// /// DataDictEntity /// [Navigate(NavigateType.OneToOne, nameof(DictTypeId), nameof(DataDictEntity.Id))] public DataDictEntity? DataDict{ get; set; }//不要给get set赋值 } }