c# 深度遍历节点并删除
2021-06-22 10:06
标签:task name node list 深度 await parent turn returns c# 深度遍历节点并删除 标签:task name node list 深度 await parent turn returns 原文地址:https://www.cnblogs.com/cxyzhangjie/p/10214571.html 1 public async Task DeleteModule(EntityDto input)
2 {
3 var id = input.Id;
4 var children = await FindChildrenAsync(id);
5
6 await DeleteAsync(children);
7
8 await _repository.DeleteAsync(id);
9 }
10 ///
> FindChildrenAsync(int? parentId)
32 {
33 return await _repository.GetAllListAsync(p => p.ParentId == parentId);
34 }