Table of Contents

Interface IQueryPerformer

Namespace
Cratis.Applications.Queries
Assembly
Cratis.Applications.dll

Defines a renderer that can render a query.

public interface IQueryPerformer
Extension Methods

Properties

Dependencies

Gets the dependencies required by the renderer.

IEnumerable<Type> Dependencies { get; }

Property Value

IEnumerable<Type>

FullyQualifiedName

Gets the fully qualified name of the query the performer can perform.

FullyQualifiedQueryName FullyQualifiedName { get; }

Property Value

FullyQualifiedQueryName

Location

Gets the location the query is at.

IEnumerable<string> Location { get; }

Property Value

IEnumerable<string>

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

QueryName

Parameters

Gets the query parameters for the performer.

QueryParameters Parameters { get; }

Property Value

QueryParameters

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

Type

Type

Gets the type of the query performer.

Type Type { get; }

Property Value

Type

Methods

IsAuthorized(QueryContext)

Checks if the current user is authorized to perform this query.

bool IsAuthorized(QueryContext context)

Parameters

context QueryContext

The context for the query.

Returns

bool

True if authorized, false if unauthorized.

Perform(QueryContext)

Renders the given query.

ValueTask<object?> Perform(QueryContext context)

Parameters

context QueryContext

The context for the query to render.

Returns

ValueTask<object>

The result of rendering the query.