Interface IQueryPerformer
- Namespace
- Cratis.Arc.Queries
- Assembly
- Cratis.Arc.Core.dll
Defines a renderer that can render a query.
public interface IQueryPerformer
- Extension Methods
Properties
AllowsAnonymousAccess
Gets a value indicating whether anonymous access is allowed for this query.
bool AllowsAnonymousAccess { get; }
Property Value
CustomRoute
Gets the custom route for the query, if one is specified via the Route attribute.
string? CustomRoute { get; }
Property Value
Dependencies
Gets the dependencies required by the renderer.
IEnumerable<Type> Dependencies { get; }
Property Value
FullyQualifiedName
Gets the fully qualified name of the query the performer can perform.
FullyQualifiedQueryName FullyQualifiedName { get; }
Property Value
Location
Gets the location the query is at.
IEnumerable<string> Location { get; }
Property Value
Remarks
This is used to determine which renderer should render a given query based on its location.
Name
Gets the name of the query the performer can perform.
QueryName Name { get; }
Property Value
Parameters
Gets the query parameters for the performer.
QueryParameters Parameters { get; }
Property Value
Remarks
This includes parameters that are not dependencies, typically those that come from query string or request parameters.
ReadModelType
Gets the type of read model the query performer is for.
Type ReadModelType { get; }
Property Value
SupportsPaging
Gets a value indicating whether this query supports server-side paging and sorting.
bool SupportsPaging { get; }
Property Value
Remarks
This is true only when the return type implements IQueryable, which allows
QueryableQueryRenderer to apply Skip and Take.
Plain IEnumerable<T> results do not support paging.
Type
Gets the type of the query performer.
Type Type { get; }
Property Value
Methods
IsAuthorized(QueryContext)
Checks if the current user is authorized to perform this query.
bool IsAuthorized(QueryContext context)
Parameters
contextQueryContextThe context for the query.
Returns
- bool
True if authorized, false if unauthorized.
Perform(QueryContext)
Renders the given query.
ValueTask<object?> Perform(QueryContext context)
Parameters
contextQueryContextThe context for the query to render.