sunpengfei
2025-08-05 356c47fb0ea1a642784e85c82833141d065bc4bc
FlexJobApi.Core/Entities/Users/Department.cs
@@ -17,7 +17,7 @@
    {
        public Department()
        {
            Childrens = [];
            Children = [];
        }
        /// <summary>
@@ -33,7 +33,12 @@
        /// <summary>
        /// 下级
        /// </summary>
        public List<Department> Childrens { get; set; }
        public List<Department> Children { get; set; }
        /// <summary>
        /// 部门路径
        /// </summary>
        public string Path { get; set; }
        /// <summary>
        /// 企业Id
@@ -64,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);