Skip to main content
Table of Contents

Interface ICommandAuditRepository

Namespace
Stratara.Abstractions.EventSourcing
Assembly
Stratara.Abstractions.dll

Persists every dispatched command for audit purposes. The CommandAuditBehavior pipeline-behavior invokes this; the returned id is propagated to subsequent event appends as the CausationId.

public interface ICommandAuditRepository
Extension Methods

Methods

AddAsync(ICommandBase, CancellationToken)

Persist command as an audit row.

Task<Guid> AddAsync(ICommandBase command, CancellationToken cancellationToken)

Parameters

command ICommandBase

The command being dispatched.

cancellationToken CancellationToken

Propagated to the write-store transaction.

Returns

Task<Guid>

The id assigned to the audit row. Used as CausationId downstream.

Exceptions

SessionRequiredException

No session context is set on the current scope.

ArgumentException

command implements INamesDataOwner and names an empty tenant or an empty user as the owner of its protected fields. No row is added.