2016-06-06 9 views

Antwort

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()}) 
+0

Hinweis id ist ein optionaler Parameter int? ID –

+0

es funktioniert nicht für Sie? @ haithamsha – Vlad

+0

nein, nicht für mich arbeiten –