Table of Contents

Class InMemoryAuditLedger

Namespace
AsiBackbone.Storage.InMemory.Audit
Assembly
AsiBackbone.Storage.InMemory.dll

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

IReadOnlyList<IDecisionReceipt>

Methods

GetByCorrelationId(string)

Gets a snapshot of records matching the supplied correlation identifier.

public IReadOnlyList<IDecisionReceipt> GetByCorrelationId(string correlationId)

Parameters

correlationId string

The 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

eventId string

The 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

residue IDecisionReceipt
cancellationToken CancellationToken

Returns

ValueTask