Table of Contents

Class FilterQueryOption

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

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 string

The raw value for $filter 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

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

string

Validator

Gets or sets the Filter Query Validator

public FilterQueryValidator Validator { get; set; }

Property Value

FilterQueryValidator

Methods

ApplyTo(IQueryable, ODataQuerySettings)

Apply the filter query to the given IQueryable.

public IQueryable ApplyTo(IQueryable query, ODataQuerySettings querySettings)

Parameters

query IQueryable

The original IQueryable.

querySettings ODataQuerySettings

The 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 IQueryable

The original IQueryable.

querySettings ODataQuerySettings

The ODataQuerySettings that contains all the query application related settings.

assembliesResolver IAssembliesResolver

The 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 ODataValidationSettings

The ODataValidationSettings instance which contains all the validation settings.