Class LocalAuditService
- Namespace
- adas_core.Application.Services
- Assembly
- adas-core.Application.dll
public class LocalAuditService : ILocalAuditService
- Inheritance
-
LocalAuditService
- Implements
- Inherited Members
- Extension Methods
Constructors
LocalAuditService(IAuditService, ILogger<LocalAuditService>)
public LocalAuditService(IAuditService auditService, ILogger<LocalAuditService> logger)
Parameters
auditServiceIAuditServiceloggerILogger<LocalAuditService>
Methods
CreateAuditLogAsync(ClaimsPrincipal?, object?, object?, string?)
Creates an audit log entry asynchronously, forwarding the provided data to the audit service with a reason when one is supplied, and logging any errors that occur.
public Task CreateAuditLogAsync(ClaimsPrincipal? user, object? dataOriginal, object? dataModified, string? reason)
Parameters
userClaimsPrincipalThe claims principal representing the user performing the action; used to attribute the audit log entry.
dataOriginalobjectThe original data before the change.
dataModifiedobjectThe modified data after the change.
reasonstringAn optional reason for the change; when null, the audit log is created without supplying a reason.
Returns
DeepCopyAsync<T>(T)
Asynchronously deep copies the specified data, attempting a primary copy method and falling back to a JSON-based copy if the primary fails. Returns the default value if both copy attempts fail.
public Task<T?> DeepCopyAsync<T>(T data)
Parameters
dataTThe data to be deep copied.
Returns
- Task<T>
A task representing the asynchronous operation, containing the deep copy of the data, or
nullif both copy methods fail.
Type Parameters
T