Class FilterQueryOption
This defines a $filter OData query option for querying.
public class FilterQueryOption
- Inheritance
-
FilterQueryOption
- Inherited Members
Constructors
FilterQueryOption(string, ODataQueryContext)
Initialize a new instance of FilterQueryOption based on the raw $filter value and an EdmModel from ODataQueryContext.
public FilterQueryOption(string rawValue, ODataQueryContext context)
Parameters
rawValue
stringThe raw value for $filter 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
FilterClause
Gets the parsed FilterClause for this query option.
public FilterClause FilterClause { get; }
Property Value
- FilterClause
RawValue
Gets the raw $filter value.
public string RawValue { get; }
Property Value
Validator
Gets or sets the Filter Query Validator
public FilterQueryValidator Validator { get; set; }
Property Value
Methods
ApplyTo(IQueryable, ODataQuerySettings)
Apply the filter query to the given IQueryable.
public IQueryable ApplyTo(IQueryable query, ODataQuerySettings querySettings)
Parameters
query
IQueryableThe original IQueryable.
querySettings
ODataQuerySettingsThe ODataQuerySettings that contains all the query application related settings.
Returns
- IQueryable
The new IQueryable after the filter query has been applied to.
ApplyTo(IQueryable, ODataQuerySettings, IAssembliesResolver)
Apply the filter query to the given IQueryable.
public IQueryable ApplyTo(IQueryable query, ODataQuerySettings querySettings, IAssembliesResolver assembliesResolver)
Parameters
query
IQueryableThe original IQueryable.
querySettings
ODataQuerySettingsThe ODataQuerySettings that contains all the query application related settings.
assembliesResolver
IAssembliesResolverThe System.Web.Http.Dispatcher.IAssembliesResolver to use.
Returns
- IQueryable
The new IQueryable after the filter query has been applied to.
Validate(ODataValidationSettings)
Validate the filter 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.