前台:
mark:注意传的参数
_projectService.deleteForTree(obj.id).done(function (data) { });
后台:
public bool DeleteForTree(int id) { var entity = _entityRepository.Get(id); var list = _entityRepository.GetAll().Where(c => c.ProjectCode.StartsWith(entity.ProjectCode)).Select(c=>c.Id).ToList(); list.ForEach(c=> { _entityRepository.Delete(c); }); return true; }