Class InMemoryAuditLedger
In-memory audit ledger intended for tests, samples, and local validation hosts.
public sealed class InMemoryAuditLedger : IDecisionReceiptSink
- Inheritance
-
InMemoryAuditLedger
- Implements
- Inherited Members
Remarks
This type is not durable storage. It records decision receipt in process memory and is suitable only for local development, tests, examples, and non-production validation flows.
Properties
Records
Gets a snapshot of all recorded decision receipt values.
public IReadOnlyList<IDecisionReceipt> Records { get; }
Property Value
Methods
GetByCorrelationId(string)
Gets a snapshot of records matching the supplied correlation identifier.
public IReadOnlyList<IDecisionReceipt> GetByCorrelationId(string correlationId)
Parameters
correlationIdstringThe correlation identifier to match.
Returns
- IReadOnlyList<IDecisionReceipt>
Decision receipt values with the supplied correlation identifier.
GetByEventId(string)
Attempts to get a record by its audit event identifier.
public IDecisionReceipt? GetByEventId(string eventId)
Parameters
eventIdstringThe audit event identifier.
Returns
- IDecisionReceipt
The matching decision receipt, or null when none is found.
WriteAsync(IDecisionReceipt, CancellationToken)
public ValueTask WriteAsync(IDecisionReceipt residue, CancellationToken cancellationToken = default)
Parameters
residueIDecisionReceiptcancellationTokenCancellationToken