Class ActorResourceQueryHandler<TQuery, TResource, TResponse>
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
TQueryA directly resource-authorized query; static permissions are optional.
TResourceThe reference-type resource loaded by the pipeline.
TResponseA 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
queryTQuerycancellationTokenCancellationToken
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
queryTQueryThe query to handle.
actorActorThe actor checked by this dispatch.
resourceTResourceThe same resource instance loaded and authorized by this dispatch.
cancellationTokenCancellationTokenThe dispatch cancellation token.
Returns
- ValueTask<TResponse>
The business outcome.