Interface IAuditEventStore
Represents a store for audit events.
Namespace: DataWeb.Audit
Assembly: DataWeb.Core.dll
Syntax
public interface IAuditEventStore
Properties
Name
Gets the name of the audit event store.
Declaration
string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
DeleteExpiredEntriesAsync(DateTimeOffset, CancellationToken)
Asynchronously deletes all audit event entries that have expired.
Declaration
Task DeleteExpiredEntriesAsync(DateTimeOffset expirationDate, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTimeOffset | expirationDate | The expiration date threshold. Entries with an expiration date on or before this date will be deleted. |
| CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation. |
Remarks
This method is typically used for routine maintenance to remove old audit entries that are no longer needed.
GetAuditEventsAsync(AuditEventFilter, CancellationToken)
Asynchronously retrieves audit events that match the specified filter.
Declaration
Task<IEnumerable<AuditEvent>> GetAuditEventsAsync(AuditEventFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AuditEventFilter | filter | The AuditEventFilter used to retrieve the audit events. |
| CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<AuditEvent>> | A task that represents the asynchronous operation. The task result contains the audit events matching the filter, or an empty collection if none are found. |
SetAsync(AuditEvent, CancellationToken)
Asynchronously adds or updates an audit event in the store.
Declaration
Task SetAsync(AuditEvent auditEvent, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AuditEvent | auditEvent | The AuditEvent to add or update in the store. |
| CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when auditEvent is null. |