private IQueryable<SysDept> LoadWithChildren(int depth, IQueryable<SysDept> query)
{
if (depth <= 0)
{
return query;
}
for (int i = 0; i < depth; i++)
{
query = query.Include($"{string.Concat(Enumerable.Repeat("Children.", i))}Children");
}
return query;
}
01-30
2908
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)