Interface IQueryRequestReader

Namespace
Cratis.Arc.Queries
Assembly
Cratis.Arc.Core.dll

Defines a reader that turns an incoming HTTP request into a parsed QueryRequest for a specific HTTP method.

public interface IQueryRequestReader
Extension Methods

Remarks

This is the extension point for query transports. Adding support for a new HTTP method or argument source is done by adding a new implementation — discovered automatically via IInstancesOf<T> — without changing the endpoint mapper.

Properties

EndpointNamePrefix

Gets the prefix used when naming the endpoint, keeping endpoint names unique across transports.

string EndpointNamePrefix { get; }

Property Value

string

HttpMethod

Gets the HTTP method this reader handles (e.g. GET, QUERY).

string HttpMethod { get; }

Property Value

string

IncludeInApiDescription

Gets a value indicating whether endpoints served by this reader should be included in the generated API description.

bool IncludeInApiDescription { get; }

Property Value

bool

RequestBodyType

Gets the type of the request body this reader expects, or null when the request has no body.

Type? RequestBodyType { get; }

Property Value

Type

ResponseCacheControl

Gets the value to set on the response Cache-Control header, or null to leave it unset.

string? ResponseCacheControl { get; }

Property Value

string

Methods

Read(IHttpRequestContext, IQueryPerformer)

Reads the QueryRequest from the given request context.

Task<QueryRequest> Read(IHttpRequestContext context, IQueryPerformer performer)

Parameters

context IHttpRequestContext

The IHttpRequestContext to read from.

performer IQueryPerformer

The IQueryPerformer the request targets, used to type-convert arguments.

Returns

Task<QueryRequest>

The parsed QueryRequest.