Interface IInterceptReadModel<TReadModel>

Namespace
Cratis.Arc.Queries
Assembly
Cratis.Arc.Core.dll

Defines a contract for intercepting a read model before it is served to a client.

public interface IInterceptReadModel<TReadModel>

Type Parameters

TReadModel

Type of read model to intercept.

Extension Methods

Remarks

Implement this interface to perform cross-cutting operations on read models, such as decryption or other transformations, both for regular and observable queries. Because read models are typically immutable records, interceptors receive the current instance and must return the (potentially replaced) instance — they must not mutate the original in place.

Methods

Intercept(TReadModel)

Intercepts the given read model and returns the intercepted result.

Task<TReadModel> Intercept(TReadModel readModel)

Parameters

readModel TReadModel

The read model instance to intercept.

Returns

Task<TReadModel>

A Task<TResult> that resolves to the intercepted read model, which may be a new instance.