using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WoodWood.Util.Validations;
namespace Wood.Entity.SystemManage
{
///
/// 字典类型信息
///
[SugarTable("SysDataDict", "字典类型信息")]
[SugarIndex("SysDataDict_FormCode", nameof(FormCode), OrderByType.Desc, true)]
public class DataDictEntity : EntityBaseExtra
{
///
/// 名称
///
[SugarColumn(ColumnDescription = "名称",Length =64)]
[Required(ErrorMessage = "必须填写字典类型名称!")]
public string DictName { get; set; } = "";
///
/// 编码
///
[SugarColumn(ColumnDescription = "编码", Length = 32)]
[Required]
[UniqueValue(ErrorMessage ="编码不能重复!")]
public string FormCode { get; set; } = "";
///
/// 排序
///
[SugarColumn(ColumnDescription = "排序")]
public int Sort { get; set; } = 0;
///
/// 字典明细信息
///
[Navigate( NavigateType.OneToMany, nameof(DataDictDetailEntity.DictTypeId))]//注意顺序
public List? Details { get; set; }
}
}