Table of Contents

Class QueryActionFilter

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

Represents a IAsyncActionFilter for providing a proper QueryResult<T> for post actions.

public class QueryActionFilter : IAsyncActionFilter, IFilterMetadata
Inheritance
QueryActionFilter
Implements
Inherited Members

Remarks

Initializes a new instance of the QueryActionFilter class.

Constructors

QueryActionFilter(IOptions<JsonOptions>, IQueryContextManager, IQueryProviders, ILogger<QueryActionFilter>)

Represents a IAsyncActionFilter for providing a proper QueryResult<T> for post actions.

public QueryActionFilter(IOptions<JsonOptions> options, IQueryContextManager queryContextManager, IQueryProviders queryProviders, ILogger<QueryActionFilter> logger)

Parameters

options IOptions<JsonOptions>

JsonOptions.

queryContextManager IQueryContextManager

IQueryContextManager.

queryProviders IQueryProviders

IQueryProviders.

logger ILogger<QueryActionFilter>

ILogger for logging.

Remarks

Initializes a new instance of the QueryActionFilter class.

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

OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate)

Called asynchronously before the action, after model binding is complete.

public Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)

Parameters

context ActionExecutingContext

The ActionExecutingContext.

next ActionExecutionDelegate

The ActionExecutionDelegate. Invoked to execute the next action filter or the action itself.

Returns

Task

A Task that on completion indicates the filter has executed.