Class QueryHttpExtensions
- Namespace
- Cratis.Arc.Queries
- Assembly
- Cratis.Arc.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
PageSizeQueryStringKey
Gets the key for the page size query string.
public const string PageSizeQueryStringKey = "pageSize"
Field Value
SortByQueryStringKey
Gets the key for the sort by query string.
public const string SortByQueryStringKey = "sortby"
Field Value
SortDirectionQueryStringKey
Gets the key for the sort direction query string.
public const string SortDirectionQueryStringKey = "sortDirection"
Field Value
Methods
GetObservableQueryHttpOptions(HttpContext)
Gets the observable query HTTP options from the HTTP request query string.
public static ObservableQueryHttpOptions GetObservableQueryHttpOptions(this HttpContext httpContext)
Parameters
httpContextHttpContextThe HTTP context.
Returns
GetPagingInfo(HttpContext)
Extracts paging information from the HTTP request query string.
public static Paging GetPagingInfo(this HttpContext httpContext)
Parameters
httpContextHttpContextThe 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
httpContextHttpContextThe HTTP context.
performerIQueryPerformerThe query performer to get for.
Returns
- QueryArguments
A dictionary of custom parameters.
Exceptions
- InvalidQueryArgument
A supplied scalar argument cannot be converted.
GetSortingInfo(HttpContext)
Extracts sorting information from the HTTP request query string.
public static Sorting GetSortingInfo(this HttpContext httpContext)
Parameters
httpContextHttpContextThe 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
responseHttpResponseThe HTTP response.
queryResultQueryResultThe query result.