CRUDServiceBaseTEntity, TKey, TInput, TFilterAddOperationLogAsync Method

记录操作日志。

Definition

Namespace: QuickAdmin.Service.CRUD
Assembly: QuickAdmin.Net (in QuickAdmin.Net.dll) Version: 2.0.10
C#
protected virtual Task AddOperationLogAsync(
	int opTypeCode,
	TEntity entity,
	string remarks,
	CancellationToken cancellationToken
)

Parameters

opTypeCode  int
操作类型代码,参见 OperationLogOPType 枚举。
entity  TEntity
操作的实体。
remarks  string
备注信息。
cancellationToken  CancellationToken
用于取消操作的令牌。

Return Value

Task

Remarks

基类内各个增删改操作方法调用此方法来记录操作日志。
内部用 opLogService 调用了 AddAsync(IOperationLogModule, int, string, string, string, CancellationToken)opContent 将为 entity.ToString()opObjectKey 将为 entity.Id.ToString()
entitynull 时不会引发异常,opContent/opObjectKey 将为 null

See Also