Table of Contents

Class EntityQueryExtensions

Namespace
Breeze.Core
Assembly
Breeze.Core.dll

Applies the clauses of an EntityQuery to an IQueryable, one clause at a time.

public static class EntityQueryExtensions
Inheritance
EntityQueryExtensions
Inherited Members

Remarks

Order matters: where first, then orderBy, skip and take, then select, and expand last. Each method is a no-op when the query has no such clause.

Methods

ApplyExpand(EntityQuery, IQueryable, Type)

Apply the query's expand clause by calling Include for each path.

public static IQueryable ApplyExpand(this EntityQuery eq, IQueryable queryable, Type eleType)

Parameters

eq EntityQuery

The query.

queryable IQueryable

The queryable to add Includes to.

eleType Type

The element type of the queryable.

Returns

IQueryable

The queryable, unchanged if there is no expand clause.

Remarks

Include is resolved dynamically, so this works against any provider that offers one.

ApplyOrderBy(EntityQuery, IQueryable, Type)

Apply the query's orderBy clause, if it has one.

public static IQueryable ApplyOrderBy(this EntityQuery eq, IQueryable queryable, Type eleType)

Parameters

eq EntityQuery

The query. It must already have been validated.

queryable IQueryable

The queryable to sort.

eleType Type

The element type of the queryable.

Returns

IQueryable

The sorted queryable, or the original if there is no orderBy clause.

ApplySelect(EntityQuery, IQueryable, Type)

Apply the query's select clause, if it has one, projecting onto a generated type.

public static IQueryable ApplySelect(this EntityQuery eq, IQueryable queryable, Type eleType)

Parameters

eq EntityQuery

The query. It must already have been validated.

queryable IQueryable

The queryable to project.

eleType Type

The element type of the queryable.

Returns

IQueryable

The projected queryable, or the original if there is no select clause.

ApplySkip(EntityQuery, IQueryable, Type)

Apply the query's skip count, if it has one.

public static IQueryable ApplySkip(this EntityQuery eq, IQueryable queryable, Type eleType)

Parameters

eq EntityQuery

The query.

queryable IQueryable

The queryable to skip within.

eleType Type

The element type of the queryable.

Returns

IQueryable

The queryable, unchanged if no skip was requested.

ApplyTake(EntityQuery, IQueryable, Type)

Apply the query's take count, if it has one.

public static IQueryable ApplyTake(this EntityQuery eq, IQueryable queryable, Type eleType)

Parameters

eq EntityQuery

The query.

queryable IQueryable

The queryable to limit.

eleType Type

The element type of the queryable.

Returns

IQueryable

The queryable, unchanged if no take was requested.

ApplyWhere(EntityQuery, IQueryable, Type)

Apply the query's where clause, if it has one.

public static IQueryable ApplyWhere(this EntityQuery eq, IQueryable queryable, Type eleType)

Parameters

eq EntityQuery

The query. It must already have been validated.

queryable IQueryable

The queryable to filter.

eleType Type

The element type of the queryable.

Returns

IQueryable

The filtered queryable, or the original if there is no where clause.

GetTakeValue(IQueryable)

Gets the minimum Take() value in the queryable Expression

public static int? GetTakeValue(IQueryable queryable)

Parameters

queryable IQueryable

Returns

int?