DeptServiceGetSelfAndParentsIdsAsync Method

获取指定子部门及其所有父部门 的 Id

Definition

Namespace: QuickAdmin.Service.Admin
Assembly: QuickAdmin.Net (in QuickAdmin.Net.dll) Version: 2.0.10
C#
public virtual Task<IList<long>> GetSelfAndParentsIdsAsync(
	long childId,
	int? maxUpLevel = null,
	CancellationToken cancellationToken = default
)

Parameters

childId  long
子部门 Id
maxUpLevel  int?  (Optional)
指示最高反向查询到子部门的第几级父部门,从 1 开始,1 表示到其直接父部门,2 表示到其父部门的父部门,以此类推。
null 表示一直查询到根部门。
cancellationToken  CancellationToken  (Optional)
用于取消操作的令牌。

Return Value

TaskIListlong
Id 列表,childId 位于列表尾部,其上侧依次为其递归父部门 IdchildId 对应部门不存在时,将返回一个空列表。

Implements

IDeptServiceGetSelfAndParentsIdsAsync(long, int?, CancellationToken)

Remarks

将从 childId 开始,反向递归查询其父部门。

See Also