mirror of
https://github.com/dotnetcore/Util.git
synced 2026-10-26 17:53:30 +08:00
25 lines
729 B
C#
25 lines
729 B
C#
using System.Collections.Generic;
|
|
using Util.Applications.Dtos;
|
|
|
|
namespace Util.Applications.Trees {
|
|
/// <summary>
|
|
/// 树形结果
|
|
/// </summary>
|
|
public class TreeResult : TreeResultBase<TreeDto, TreeDto,List<TreeDto>> {
|
|
public TreeResult( IEnumerable<TreeDto> data, bool async = false ) : base( data, async ) {
|
|
}
|
|
|
|
protected override TreeDto ToDestinationNode( TreeDto node ) {
|
|
return new TreeDto {
|
|
Id = node.Id,
|
|
Leaf = node.Leaf,
|
|
Children = node.Children
|
|
};
|
|
}
|
|
|
|
protected override List<TreeDto> ToResult( List<TreeDto> nodes ) {
|
|
return nodes;
|
|
}
|
|
}
|
|
}
|