调整结构

This commit is contained in:
yubaolee
2017-10-11 16:19:34 +08:00
parent 22ba70b47c
commit 0659eb84c1
101 changed files with 2349 additions and 2224 deletions

View File

@@ -29,7 +29,12 @@ namespace Infrastructure
Func<T, K> parentIdSelector,
K rootId = default(K))
{
foreach (var c in collection.Where(c => parentIdSelector(c).Equals(rootId)))
foreach (var c in collection.Where(u =>
{
var selector = parentIdSelector(u);
return (rootId == null && selector == null)
|| (rootId != null &&rootId.Equals(selector));
}))
{
yield return new TreeItem<T>
{