Table of Contents

Class SortParser

Namespace
JsonApiDotNetCore.Queries.Parsing
Assembly
JsonApiDotNetCore.dll

Parses the JSON:API 'sort' query string parameter value.

[PublicAPI]
public class SortParser : QueryExpressionParser, ISortParser
Inheritance
SortParser
Implements
Inherited Members

Methods

IsFunction(string)

protected virtual bool IsFunction(string name)

Parameters

name string

Returns

bool

Parse(string, ResourceType)

Parses the specified source into a SortExpression. Throws a QueryParseException if the input is invalid.

public SortExpression Parse(string source, ResourceType resourceType)

Parameters

source string

The source text to read from.

resourceType ResourceType

The resource type used to lookup JSON:API fields that are referenced in source.

Returns

SortExpression

ParseFunction(ResourceType)

protected virtual FunctionExpression ParseFunction(ResourceType resourceType)

Parameters

resourceType ResourceType

Returns

FunctionExpression

ParseSort(ResourceType)

protected virtual SortExpression ParseSort(ResourceType resourceType)

Parameters

resourceType ResourceType

Returns

SortExpression

ParseSortElement(ResourceType)

protected virtual SortElementExpression ParseSortElement(ResourceType resourceType)

Parameters

resourceType ResourceType

Returns

SortElementExpression

ValidateField(ResourceFieldAttribute, int)

Enables derived types to throw a QueryParseException when usage of a JSON:API field inside a field chain is not permitted.

protected override void ValidateField(ResourceFieldAttribute field, int position)

Parameters

field ResourceFieldAttribute
position int