Table of Contents

Interface ITransactionalProjectionStore<TProjection>

Namespace
Excalibur.EventSourcing
Assembly
Excalibur.EventSourcing.Abstractions.dll

Optional persistence of a complete aggregate-local model in the event transaction.

public interface ITransactionalProjectionStore<TProjection> where TProjection : class

Type Parameters

TProjection

The model type whose serializer produced the JSON.

Remarks

Resolve through the projection store's capability surface. Implementations must reject mismatched destinations and preserve tenant and retirement boundaries. This operation advances no global cursor.

Methods

Serialize(TProjection)

Serializes a model with the destination's configured wire format.

[RequiresUnreferencedCode("Projection serialization may use reflection. Use generated metadata instead.")]
[RequiresDynamicCode("Projection serialization may require dynamic code. Use generated metadata instead.")]
string Serialize(TProjection projection)

Parameters

projection TProjection

Model to persist.

Returns

string

Serialized model.

Serialize(TProjection, JsonTypeInfo<TProjection>)

Serializes a model with generated metadata and the destination's configured wire format.

string Serialize(TProjection projection, JsonTypeInfo<TProjection> typeInfo)

Parameters

projection TProjection

Model to persist.

typeInfo JsonTypeInfo<TProjection>

Generated type metadata.

Returns

string

Serialized model.

WriteAsync(ProjectionTransaction, string, string, string, CancellationToken)

Writes serialized state on the supplied transaction without committing it.

ValueTask WriteAsync(ProjectionTransaction transaction, string aggregateId, string aggregateType, string json, CancellationToken cancellationToken)

Parameters

transaction ProjectionTransaction

Owning event transaction and source boundary.

aggregateId string

Projection key, equal to the aggregate identifier.

aggregateType string

The one aggregate type this destination belongs to.

json string

Complete model serialized with registered projection metadata.

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask

A task completed when the enlisted write finishes.