Class TopQueryOption
This defines a $top OData query option for querying.
public class TopQueryOption
- Inheritance
-
TopQueryOption
- Inherited Members
Constructors
TopQueryOption(string, ODataQueryContext)
Initialize a new instance of TopQueryOption based on the raw $top value and an EdmModel from ODataQueryContext.
public TopQueryOption(string rawValue, ODataQueryContext context)
Parameters
rawValue
stringThe raw value for $top query. It can be null or empty.
context
ODataQueryContextThe ODataQueryContext which contains the Microsoft.Data.Edm.IEdmModel and some type information
Properties
Context
Gets the given ODataQueryContext.
public ODataQueryContext Context { get; }
Property Value
RawValue
Gets the raw $top value.
public string RawValue { get; }
Property Value
Validator
Gets or sets the Top Query Validator.
public TopQueryValidator Validator { get; set; }
Property Value
Value
Gets the value of the $top as a parsed integer.
public int Value { get; }
Property Value
Methods
ApplyTo(IQueryable, ODataQuerySettings)
Apply the $top query to the given IQueryable.
public IQueryable ApplyTo(IQueryable query, ODataQuerySettings querySettings)
Parameters
query
IQueryableThe original IQueryable.
querySettings
ODataQuerySettingsThe query settings to use while applying this query option.
Returns
- IQueryable
The new IQueryable after the top query has been applied to.
ApplyTo<T>(IQueryable<T>, ODataQuerySettings)
Apply the $top query to the given IQueryable.
public IOrderedQueryable<T> ApplyTo<T>(IQueryable<T> query, ODataQuerySettings querySettings)
Parameters
query
IQueryable<T>The original IQueryable.
querySettings
ODataQuerySettingsThe query settings to use while applying this query option.
Returns
- IOrderedQueryable<T>
The new IQueryable after the top query has been applied to.
Type Parameters
T
Validate(ODataValidationSettings)
Validate the top query based on the given validationSettings
. It throws an ODataException if validation failed.
public void Validate(ODataValidationSettings validationSettings)
Parameters
validationSettings
ODataValidationSettingsThe ODataValidationSettings instance which contains all the validation settings.