Table of Contents

Class SaveSagaRequest<TSagaState>

Namespace
Excalibur.Saga.SqlServer.Requests
Assembly
Excalibur.Saga.SqlServer.dll

Represents a data request to save a saga state to the SQL Server saga store.

public sealed class SaveSagaRequest<TSagaState> : DataRequestBase<IDbConnection, int>, IDataRequest<IDbConnection, int>, IDataRequest where TSagaState : SagaState

Type Parameters

TSagaState

The type of the saga state.

Inheritance
SaveSagaRequest<TSagaState>
Implements
Inherited Members

Constructors

SaveSagaRequest(TSagaState, DispatchJsonSerializer, string, TenantScope, CancellationToken)

Initializes a new instance of the SaveSagaRequest<TSagaState> class.

[RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed.")]
[RequiresDynamicCode("JSON serialization and deserialization might require runtime code generation.")]
public SaveSagaRequest(TSagaState sagaState, DispatchJsonSerializer serializer, string qualifiedTableName, TenantScope scope, CancellationToken cancellationToken)

Parameters

sagaState TSagaState

The saga state to save.

serializer DispatchJsonSerializer

The JSON serializer for serializing saga state.

qualifiedTableName string

The fully qualified saga table name.

scope TenantScope

The tenant scope. When tenant-scoped it is the isolation authority: the saga row is stamped with this tenant and the version-gated MERGE match additionally requires the persisted tenant to equal it, so a save under one tenant can never match (and overwrite) another tenant's saga. When the scope is untenanted it stamps the reserved sentinel, not an absent tenant, so the term is present either way and the match predicate is unconditional. A tenant-scoped scope cannot be constructed without a tenant, so a predicate-less save while tenancy is active is unrepresentable.

cancellationToken CancellationToken

The cancellation token.

Exceptions

ArgumentOutOfRangeException

The saga state's version is negative.

OverflowException

The saga state's version is MaxValue and cannot be incremented.