SortableCommonCRUDServiceTEntity, TKey, TInput, TFilterPrepareNewEntityAsync Method

重写后的预处理新实体方法。

Definition

Namespace: QuickAdmin.Service.CRUD
Assembly: QuickAdmin.Net (in QuickAdmin.Net.dll) Version: 3.0.0
C#
protected override Task<IServiceResult<TEntity>> PrepareNewEntityAsync(
	TInput input,
	TEntity entity,
	CancellationToken cancellationToken
)

Parameters

input  TInput
实体输入 DTO。
entity  TEntity
将要添加的实体,由 input 映射而来。
若 TInput 和 TEntity 类型一样,entity 与 input 将为同一实例。
cancellationToken  CancellationToken
用于取消操作的令牌。

Return Value

TaskIServiceResultTEntity
服务调用结果。若成功,其数据即为加工过后的 entity。

Remarks

在基类预处理方法的基础上,再将实体的 DisplayOrder 置为由 GetNextDisplayOrderAsync(TEntity, CancellationToken) 返回的数值。

See Also