sunpengfei
2025-08-06 fe910d268980a24ad6ba565f045ecae792bc208c
FlexJobApi.Core/Entities/Common/DictionaryData.cs
@@ -13,11 +13,11 @@
    /// <summary>
    /// 字典数据
    /// </summary>
    public class DictionaryData : CommonEntity, IEntityTypeBuilder<DictionaryData>
    public class DictionaryData : CommonEntity, IEntityTypeBuilder<DictionaryData>, ITreeData<DictionaryData>, IIsDisabled
    {
        public DictionaryData()
        {
            Childrens = [];
            Children = [];
        }
        /// <summary>
@@ -43,7 +43,12 @@
        /// <summary>
        /// 下级
        /// </summary>
        public List<DictionaryData> Childrens { get; set; }
        public List<DictionaryData> Children { get; set; }
        /// <summary>
        /// 字典路径
        /// </summary>
        public string Path { get; set; }
        /// <summary>
        /// 编号
@@ -82,10 +87,15 @@
        /// </summary>
        public string Field5 { get; set; }
        /// <summary>
        /// 是否禁用
        /// </summary>
        public bool IsDisabled { get; set; }
        public void Configure(EntityTypeBuilder<DictionaryData> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            entityBuilder
                .HasMany(x => x.Childrens)
                .HasMany(x => x.Children)
                .WithOne(x => x.Parent)
                .HasForeignKey(x => x.ParentId)
                .OnDelete(DeleteBehavior.ClientSetNull);