TreeEntityService<TTreeEntity> Class

实现对主键类型为 string 类型的树形结构实体进行各种树形查询的通用服务泛型基类。

Definition

Namespace: QuickAdmin.Service
Assembly: QuickAdmin.Net (in QuickAdmin.Net.dll) Version: 1.2.4
C#
[NotUseDI]
public class TreeEntityService<TTreeEntity> : ITreeEntityService<TTreeEntity>
where TTreeEntity : class, object, ITreeEntity<TTreeEntity>
Inheritance
object    TreeEntityService<TTreeEntity>
Derived
Implements
ITreeEntityService<TTreeEntity>

Type Parameters

TTreeEntity
树形实体类型。

Constructors

TreeEntityService<TTreeEntity>() 初始化新实例,fsql 将被置为全局 fsql
TreeEntityService<TTreeEntity>(IFreeSql) 使用指定的 IFreeSql 初始化新实例。

Properties

Protected Properties

ISelectObj 获取 ISelect 对象。

Methods

Public Methods

GetDirectChildren 获取指定父记录的直接子记录(不递归,不含父记录)。
GetDirectChildrenAsync 获取指定父记录的直接子记录(不递归,不含父记录)。
GetDirectChildrenIds 获取指定父记录的直接子记录的 Id(不递归,不含父记录 Id)。
GetDirectChildrenIdsAsync 获取指定父记录的直接子记录的 Id(不递归,不含父记录 Id)。
GetNamePath 获取指定记录的名称路径。
GetNamePathAsync 获取指定记录的名称路径。
GetParent 获取指定子记录的指定级别父记录。
GetParentAsync 获取指定子记录的指定级别父记录。
GetSelfAndChildrenIdsRecursive 获取指定父记录的所有子记录的 Id(使用 CTE 递归查询,结果包含父记录 Id)。
GetSelfAndChildrenIdsRecursiveAsync 获取指定父记录的所有子记录的 Id(使用 CTE 递归查询,结果包含父记录 Id)。
GetSelfAndChildrenRecursive 获取指定父记录的所有子记录(使用 CTE 递归查询,结果包含父记录)。
GetSelfAndChildrenRecursiveAsync 获取指定父记录的所有子记录(使用 CTE 递归查询,结果包含父记录)。
GetSelfAndParents 获取指定子记录及其所有父记录。
GetSelfAndParentsAsync 获取指定子记录及其所有父记录。
GetSelfAndParentsIds 获取指定子记录及其所有父记录 的 Id
GetSelfAndParentsIdsAsync 获取指定子记录及其所有父记录 的 Id
GetSelfAndParentsList 获取一个记录列表,包含指定子记录及其所有的父记录。
GetSelfAndParentsListAsync 获取一个记录列表,包含指定子记录及其所有的父记录。
GetSelfOrParent 获取指定子记录的指定级别父记录或其自己。
GetSelfOrParentAsync 获取指定子记录的指定级别父记录或其自己。
GetSimulateTreeList 获取指定父记录的所有子记录(使用 CTE 递归查询,结果包含父记录),并加工为模拟树形列表。
GetSimulateTreeListAsync 获取指定父记录的所有子记录(使用 CTE 递归查询,结果包含父记录),并加工为模拟树形列表。
GetTreeList 获取指定父记录的所有子记录(使用 CTE 递归查询,结果包含父记录),并加工为树形列表。
GetTreeListAsync 获取指定父记录的所有子记录(使用 CTE 递归查询,结果包含父记录),并加工为树形列表。
IsParentOf 检测两个记录是否具有父子关系。
IsParentOfAsync 检测两个记录是否具有父子关系。
SetParents 递归设置指定子实体的各级父实体。
SetParentsAsync 递归设置指定子实体的各级父实体。

Protected Methods

GetNameStringForNamePath 获取用来在名称路径中使用的名称字符串。

Fields

Protected Fields

fsql 本服务要操作的数据所用的 IFreeSql 实例。

See Also