Class ReadModelInterceptorsExtensions

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

Extension methods for IReadModelInterceptors covering observable query emissions.

public static class ReadModelInterceptorsExtensions
Inheritance
ReadModelInterceptorsExtensions
Inherited Members

Methods

InterceptEmission(IReadModelInterceptors, Type, object?, IServiceProvider)

Intercepts a single value emitted by an observable query, applying the registered IInterceptReadModel<TReadModel> interceptors per read model while preserving the emitted shape. Collection emissions (an IEnumerable<T> of read models) are intercepted element by element, keyed by the read model type rather than the enumerable type — without this, a collection query would look for a non-existent interceptor for the enumerable and silently skip compliance/PII release.

public static Task<object> InterceptEmission(this IReadModelInterceptors interceptors, Type emittedType, object? value, IServiceProvider serviceProvider)

Parameters

interceptors IReadModelInterceptors

The IReadModelInterceptors to apply.

emittedType Type

The element type of the observable: the read model, or an enumerable of read models for collection queries.

value object

The emitted value to intercept.

serviceProvider IServiceProvider

The IServiceProvider used to resolve interceptors.

Returns

Task<object>

The intercepted value, in the same shape (single value or enumerable) as the input.