Table of Contents

Class ActorResourceQueryHandler<TQuery, TResource, TResponse>

Namespace
Trellis.Mediator
Assembly
Trellis.Mediator.dll

Supplies the checked actor and directly authorized resource to query business logic.

public abstract class ActorResourceQueryHandler<TQuery, TResource, TResponse> : IQueryHandler<TQuery, TResponse> where TQuery : IQuery<TResponse>, IAuthorizeResource<TResource> where TResource : class where TResponse : IResult, IFailureFactory<TResponse>

Type Parameters

TQuery

A directly resource-authorized query; static permissions are optional.

TResource

The reference-type resource loaded by the pipeline.

TResponse

A result-compatible response.

Inheritance
ActorResourceQueryHandler<TQuery, TResource, TResponse>
Implements
IQueryHandler<TQuery, TResponse>
Inherited Members
Extension Methods

Methods

Handle(TQuery, CancellationToken)

public ValueTask<TResponse> Handle(TQuery query, CancellationToken cancellationToken)

Parameters

query TQuery
cancellationToken CancellationToken

Returns

ValueTask<TResponse>

Handle(TQuery, Actor, TResource, CancellationToken)

Executes query business logic with the exact checked actor and loaded resource.

protected abstract ValueTask<TResponse> Handle(TQuery query, Actor actor, TResource resource, CancellationToken cancellationToken)

Parameters

query TQuery

The query to handle.

actor Actor

The actor checked by this dispatch.

resource TResource

The same resource instance loaded and authorized by this dispatch.

cancellationToken CancellationToken

The dispatch cancellation token.

Returns

ValueTask<TResponse>

The business outcome.