Skip to content

Interface IQueryHandler

Namespace: Cephalon.Abstractions.Data
Assembly: Cephalon.Abstractions.dll

Handles a read-side request and returns the requested result.

public interface IQueryHandler<in TQuery, TResult> where TQuery : IQuery<TResult>

TQuery

The query type handled by the contract.

TResult

The result type returned by the query.

Handles the supplied query.

ValueTask<TResult> HandleAsync(TQuery query, CancellationToken cancellationToken = default)

query TQuery

The query to execute.

cancellationToken CancellationToken

The token that cancels the operation.

ValueTask<TResult>

A task that completes with the result produced by the query.