using Furion.DatabaseAccessor; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace iWare.Wms.Core { /// /// 字典类型表 /// [Table("sys_dict_type")] [Comment("字典类型表")] public class SysDictType : DEntityBase, IEntityTypeBuilder { /// /// 名称 /// [Comment("名称")] [Required, MaxLength(50)] public string Name { get; set; } /// /// 编码 /// [Comment("编码")] [Required, MaxLength(50)] public string Code { get; set; } /// /// 排序 /// [Comment("排序")] public int Sort { get; set; } /// /// 备注 /// [Comment("备注")] [MaxLength(100)] public string Remark { get; set; } /// /// 状态(字典 0正常 1停用 2删除) /// [Comment("状态")] public CommonStatus Status { get; set; } = CommonStatus.ENABLE; /// /// 字典数据 /// public ICollection SysDictDatas { get; set; } public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator) { entityBuilder.HasMany(x => x.SysDictDatas) .WithOne(x => x.SysDictType) .HasForeignKey(x => x.TypeId); } } }