Table of Contents

Class ActorResourceViaQueryHandler<TQuery, TLeaf, TOwner, TResponse>

Namespace
Trellis.Mediator
Assembly
Trellis.Mediator.dll

Supplies the checked actor and loaded leaf, not its authorization owners, to query business logic.

public abstract class ActorResourceViaQueryHandler<TQuery, TLeaf, TOwner, TResponse> : IQueryHandler<TQuery, TResponse> where TQuery : IQuery<TResponse>, IAuthorizeResourceVia<TOwner> where TLeaf : class where TResponse : IResult, IFailureFactory<TResponse>

Type Parameters

TQuery

An indirectly resource-authorized query; static permissions are optional.

TLeaf

The reference-type leaf identified by the query and loaded by the pipeline.

TOwner

The authorization target type at the end of the registered path.

TResponse

A result-compatible response.

Inheritance
ActorResourceViaQueryHandler<TQuery, TLeaf, TOwner, 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, TLeaf, CancellationToken)

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

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

Parameters

query TQuery

The query to handle.

actor Actor

The actor checked against the owner resources.

leaf TLeaf

The same leaf loaded by this dispatch, not its owner resources.

cancellationToken CancellationToken

The dispatch cancellation token.

Returns

ValueTask<TResponse>

The business outcome.