Interface IReadModelInterceptors

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

Defines a system for running discovered IInterceptReadModel<TReadModel> instances against read model items.

public interface IReadModelInterceptors
Extension Methods

Methods

Intercept(Type, IEnumerable<object>, IServiceProvider)

Applies all discovered interceptors for the given read model type to every item in the collection and returns the resulting (potentially replaced) items.

Task<IEnumerable<object>> Intercept(Type readModelType, IEnumerable<object> items, IServiceProvider serviceProvider)

Parameters

readModelType Type

The type of the read model being intercepted.

items IEnumerable<object>

The read model items to intercept.

serviceProvider IServiceProvider

The IServiceProvider used to create interceptor instances and resolve their dependencies.

Returns

Task<IEnumerable<object>>

A Task<TResult> resolving to the intercepted items, which may be new instances.