Table of Contents

Class OrderByQueryOption

Namespace
System.Web.Http.OData.Query
Assembly
System.Web.Http.OData.dll

This defines a $orderby OData query option for querying.

public class OrderByQueryOption
Inheritance
OrderByQueryOption
Inherited Members

Constructors

OrderByQueryOption(string, ODataQueryContext)

Initialize a new instance of OrderByQueryOption based on the raw $orderby value and an EdmModel from ODataQueryContext.

public OrderByQueryOption(string rawValue, ODataQueryContext context)

Parameters

rawValue string

The raw value for $orderby query. It can be null or empty.

context ODataQueryContext

The ODataQueryContext which contains the Microsoft.Data.Edm.IEdmModel and some type information

Properties

Context

Gets the given ODataQueryContext.

public ODataQueryContext Context { get; }

Property Value

ODataQueryContext

OrderByClause

Gets the parsed OrderByClause for this query option.

public OrderByClause OrderByClause { get; }

Property Value

OrderByClause

OrderByNodes

Gets the mutable list of OrderByPropertyNode instances for this query option.

public IList<OrderByNode> OrderByNodes { get; }

Property Value

IList<OrderByNode>

RawValue

Gets the raw $orderby value.

public string RawValue { get; }

Property Value

string

Validator

Gets or sets the OrderBy Query Validator.

public OrderByQueryValidator Validator { get; set; }

Property Value

OrderByQueryValidator

Methods

ApplyTo(IQueryable)

Apply the $orderby query to the given IQueryable.

public IOrderedQueryable ApplyTo(IQueryable query)

Parameters

query IQueryable

The original IQueryable.

Returns

IOrderedQueryable

The new IQueryable after the orderby query has been applied to.

ApplyTo(IQueryable, ODataQuerySettings)

Apply the $orderby query to the given IQueryable.

public IOrderedQueryable ApplyTo(IQueryable query, ODataQuerySettings querySettings)

Parameters

query IQueryable

The original IQueryable.

querySettings ODataQuerySettings

The ODataQuerySettings that contains all the query application related settings.

Returns

IOrderedQueryable

The new IQueryable after the orderby query has been applied to.

ApplyTo<T>(IQueryable<T>)

Apply the $orderby query to the given IQueryable.

public IOrderedQueryable<T> ApplyTo<T>(IQueryable<T> query)

Parameters

query IQueryable<T>

The original IQueryable.

Returns

IOrderedQueryable<T>

The new IQueryable after the orderby query has been applied to.

Type Parameters

T

ApplyTo<T>(IQueryable<T>, ODataQuerySettings)

Apply the $orderby query to the given IQueryable.

public IOrderedQueryable<T> ApplyTo<T>(IQueryable<T> query, ODataQuerySettings querySettings)

Parameters

query IQueryable<T>

The original IQueryable.

querySettings ODataQuerySettings

The ODataQuerySettings that contains all the query application related settings.

Returns

IOrderedQueryable<T>

The new IQueryable after the orderby query has been applied to.

Type Parameters

T

Validate(ODataValidationSettings)

Validate the orderby query based on the given validationSettings. It throws an ODataException if validation failed.

public void Validate(ODataValidationSettings validationSettings)

Parameters

validationSettings ODataValidationSettings

The ODataValidationSettings instance which contains all the validation settings.