Table of Contents

Class QueryHttpExtensions

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

Provides common query processing functionality that can be used by both controller-based queries and pipeline-based queries.

public static class QueryHttpExtensions
Inheritance
QueryHttpExtensions
Inherited Members

Fields

PageQueryStringKey

Gets the key for the page query string.

public const string PageQueryStringKey = "page"

Field Value

string

PageSizeQueryStringKey

Gets the key for the page size query string.

public const string PageSizeQueryStringKey = "pageSize"

Field Value

string

SortByQueryStringKey

Gets the key for the sort by query string.

public const string SortByQueryStringKey = "sortby"

Field Value

string

SortDirectionQueryStringKey

Gets the key for the sort direction query string.

public const string SortDirectionQueryStringKey = "sortDirection"

Field Value

string

Methods

GetPagingInfo(HttpContext)

Extracts paging information from the HTTP request query string.

public static Paging GetPagingInfo(this HttpContext httpContext)

Parameters

httpContext HttpContext

The HTTP context.

Returns

Paging

The paging information.

GetQueryArguments(HttpContext, IQueryPerformer)

Extracts custom parameters from the HTTP request query string, excluding standard query processing parameters.

public static QueryArguments GetQueryArguments(this HttpContext httpContext, IQueryPerformer performer)

Parameters

httpContext HttpContext

The HTTP context.

performer IQueryPerformer

The query performer to get for.

Returns

QueryArguments

A dictionary of custom parameters.

GetSortingInfo(HttpContext)

Extracts sorting information from the HTTP request query string.

public static Sorting GetSortingInfo(this HttpContext httpContext)

Parameters

httpContext HttpContext

The HTTP context.

Returns

Sorting

The sorting information.

SetResponseStatusCode(HttpResponse, QueryResult)

Sets the HTTP response status code based on the query result.

public static void SetResponseStatusCode(this HttpResponse response, QueryResult queryResult)

Parameters

response HttpResponse

The HTTP response.

queryResult QueryResult

The query result.