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
interceptorsIReadModelInterceptorsThe IReadModelInterceptors to apply.
emittedTypeTypeThe element type of the observable: the read model, or an enumerable of read models for collection queries.
valueobjectThe emitted value to intercept.
serviceProviderIServiceProviderThe IServiceProvider used to resolve interceptors.