Table of Contents

Class QueryableExtensions

Namespace
Cratis.Applications.Queries
Assembly
Cratis.Applications.dll

Provides a set of methods for working with IQueryable.

public static class QueryableExtensions
Inheritance
QueryableExtensions
Inherited Members

Methods

Count(IQueryable)

Returns the number of elements in a sequence.

public static int Count(this IQueryable queryable)

Parameters

queryable IQueryable

The IQueryable to adorn.

Returns

int

The number of elements in the input sequence.

OrderBy(IQueryable, string, SortDirection)

Sorts the elements of a sequence in ascending or descending order according to a key.

public static IQueryable OrderBy(this IQueryable queryable, string field, SortDirection direction = SortDirection.Ascending)

Parameters

queryable IQueryable

The IQueryable to adorn.

field string

The name of the field to order on.

direction SortDirection

Optional direction of sort. Defaults to ascending.

Returns

IQueryable

An IQueryable for continuation.

OrderByDescending(IQueryable, string)

Sorts the elements of a sequence in descending order according to a key.

public static IQueryable OrderByDescending(this IQueryable queryable, string field)

Parameters

queryable IQueryable

The IQueryable to adorn.

field string

The name of the field to order on.

Returns

IQueryable

An IQueryable for continuation.

Skip(IQueryable, int)

Bypasses a specified number of elements in a sequence and then returns the remaining elements.

public static IQueryable Skip(this IQueryable queryable, int count)

Parameters

queryable IQueryable

An IQueryable to adorn.

count int

The number of elements to skip before returning the remaining elements.

Returns

IQueryable

An IQueryable for continuation.

Take(IQueryable, int)

Returns a specified number of contiguous elements from the start of a sequence.

public static IQueryable Take(this IQueryable queryable, int count)

Parameters

queryable IQueryable

The IQueryable to adorn.

count int

The number of elements to return.

Returns

IQueryable

An IQueryable for continuation.