Table of Contents

Class SaveSnapshotRequest

Namespace
Excalibur.EventSourcing.SqlServer.Requests
Assembly
Excalibur.EventSourcing.SqlServer.dll

Data request to save (upsert) a snapshot for an aggregate. Upserts with a guarded UPDATE-then-INSERT so that writers for different aggregates take row locks on a primary-key seek rather than key-range locks, which is what lets concurrent saves proceed.

public sealed class SaveSnapshotRequest : DataRequestBase<IDbConnection, int>, IDataRequest<IDbConnection, int>, IDataRequest
Inheritance
SaveSnapshotRequest
Implements
Inherited Members

Constructors

SaveSnapshotRequest(ISnapshot, TenantScope, CancellationToken, string, string)

Initializes a new instance of the SaveSnapshotRequest class.

public SaveSnapshotRequest(ISnapshot snapshot, TenantScope scope, CancellationToken cancellationToken, string schema = "dbo", string table = "EventStoreSnapshots")

Parameters

snapshot ISnapshot

The snapshot to save.

scope TenantScope

The tenant scope. The tenant is part of the merge key in every case: an untenanted row is keyed under the reserved sentinel the schema defaults to, not outside the key. Two tenants holding the same aggregate identifier therefore occupy separate rows, and an unscoped save cannot match a tenant-scoped row.

cancellationToken CancellationToken

The cancellation token.

schema string

The schema name for the snapshot store table. Default: "dbo".

table string

The snapshot store table name. Default: "EventStoreSnapshots".