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
TProjectionThe 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
projectionTProjectionModel 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
projectionTProjectionModel to persist.
typeInfoJsonTypeInfo<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
transactionProjectionTransactionOwning event transaction and source boundary.
aggregateIdstringProjection key, equal to the aggregate identifier.
aggregateTypestringThe one aggregate type this destination belongs to.
jsonstringComplete model serialized with registered projection metadata.
cancellationTokenCancellationTokenCancellation token.
Returns
- ValueTask
A task completed when the enlisted write finishes.