标签: c# linq ef-code-first
我想用lambda表达式转换此代码
HINTERNET
答案 0 :(得分:1)
dataContext.AccountTrees.Where(e => id.HasValue ? e.ParentId.Value == id.Value : e.ParentId == null).Select(x => new {id = e.AccountId, Name = e.Name, hasChildren = e.AccountTrees1.Any()})