sunpengfei
2025-08-07 a8b475881959d4a88d821951a615f03e7d0d1725
FlexJobApi.Core/Entities/Users/Department.cs
@@ -13,11 +13,11 @@
    /// <summary>
    /// 部门
    /// </summary>
    public class Department : CommonEntity, IEntityTypeBuilder<Department>
    public class Department : CommonEntity, IEntityTypeBuilder<Department>, IIsDisabled
    {
        public Department()
        {
            Childrens = [];
            Children = [];
        }
        /// <summary>
@@ -33,7 +33,7 @@
        /// <summary>
        /// 下级
        /// </summary>
        public List<Department> Childrens { get; set; }
        public List<Department> Children { get; set; }
        /// <summary>
        /// 部门路径
@@ -69,7 +69,7 @@
        public void Configure(EntityTypeBuilder<Department> 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);