Table of Contents

Class ODataQueryProvider

Namespace
Utils.OData.Linq
Assembly
Utils.OData.dll

Provides the LINQ provider responsible for compiling OData queries.

public sealed class ODataQueryProvider : IQueryProvider
Inheritance
ODataQueryProvider
Implements
Inherited Members
Extension Methods

Constructors

ODataQueryProvider(string)

Initializes a new instance of the ODataQueryProvider class.

public ODataQueryProvider(string entitySetName)

Parameters

entitySetName string

The entity set associated with the provider.

Exceptions

ArgumentException

Thrown when entitySetName is null or whitespace.

Methods

Compile(Expression)

Compiles the provided expression tree into an ODataQueryCompilation instance.

public ODataQueryCompilation Compile(Expression expression)

Parameters

expression Expression

Expression tree describing the query.

Returns

ODataQueryCompilation

The compiled query.

Exceptions

ArgumentNullException

Thrown when expression is null.

CreateQuery(Expression)

Creates a query from an expression tree without a compile-time generic argument.

public IQueryable CreateQuery(Expression expression)

Parameters

expression Expression

The expression tree representing the query.

Returns

IQueryable

An IQueryable instance.

CreateQuery<TElement>(Expression)

Creates a strongly typed query from an expression tree.

public IQueryable<TElement> CreateQuery<TElement>(Expression expression)

Parameters

expression Expression

The expression tree representing the query.

Returns

IQueryable<TElement>

A new ODataQueryable<TEntity> instance.

Type Parameters

TElement

Type of the entity represented by the query.

Execute(Expression)

Executes the query represented by an expression tree and converts it into an ODataQueryCompilation.

public object Execute(Expression expression)

Parameters

expression Expression

The expression tree to compile.

Returns

object

The compiled query representation.

Execute<TResult>(Expression)

Executes the query represented by an expression tree and converts it into an ODataQueryCompilation.

public TResult Execute<TResult>(Expression expression)

Parameters

expression Expression

The expression tree to compile.

Returns

TResult

The compiled query representation.

Type Parameters

TResult

Type expected by the caller.