Interface ILocalAuditService
- Namespace
- adas_core.Application.Services.Interfaces
- Assembly
- adas-core.Application.dll
public interface ILocalAuditService
- Extension Methods
Methods
CreateAuditLogAsync(ClaimsPrincipal?, object?, object?, string?)
Creates an asynchronous audit log entry capturing the original and modified data along with the user responsible for the change.
Task CreateAuditLogAsync(ClaimsPrincipal? user, object? dataOriginal, object? dataModified, string? reason = null)
Parameters
userClaimsPrincipalThe claims principal representing the user who performed the action being audited. May be null if the action is performed by an unauthenticated or system context.
dataOriginalobjectThe original state of the data before the change. May be null when the action creates a new record.
dataModifiedobjectThe modified state of the data after the change. May be null when the action deletes an existing record.
reasonstringAn optional explanation or justification for the change. Defaults to null when no reason is provided.
Returns
- Task
A task that represents the asynchronous creation of the audit log entry.
DeepCopyAsync<T>(T)
Asynchronously creates a deep copy of the specified data, producing a new independent instance of the same type.
Task<T?> DeepCopyAsync<T>(T data)
Parameters
dataTThe data instance to be deep copied.
Returns
- Task<T>
A task that represents the asynchronous operation, containing the deep-copied instance of type
T, ornullif the copy could not be produced.
Type Parameters
T