C# Class Telerik.Web.Mvc.Extensions.QueryableExtensions

Show file Open project: juanplopes/simple-telerik

Public Methods

Method Description
Aggregate ( this source, IEnumerable aggregateFunctions ) : AggregateResultCollection

Calculates the results of given aggregates functions on a sequence of elements.

Count ( this source ) : int

Returns the number of elements in a sequence.

ElementAt ( this source, int index ) : object

Returns the element at a specified index in a sequence.

GroupBy ( this source, IEnumerable groupDescriptors ) : IQueryable

Groups the elements of a sequence according to a specified groupDescriptors.

GroupBy ( this source, LambdaExpression keySelector ) : IQueryable

Groups the elements of a sequence according to a specified key selector function.

OrderBy ( this source, LambdaExpression keySelector ) : IQueryable

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

OrderBy ( this source, LambdaExpression keySelector, ListSortDirection sortDirection ) : IQueryable

Calls OrderBy(System.Linq.IQueryable,System.Linq.Expressions.LambdaExpression) or OrderByDescending depending on the sortDirection.

OrderByDescending ( this source, LambdaExpression keySelector ) : IQueryable

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

Page ( this source, int pageIndex, int pageSize ) : IQueryable

Pages through the elements of a sequence until the specified pageIndex using pageSize.

Select ( this source, LambdaExpression selector ) : IQueryable

Projects each element of a sequence into a new form.

Skip ( this source, int count ) : IQueryable

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

Sort ( this source, IEnumerable sortDescriptors ) : IQueryable

Sorts the elements of a sequence using the specified sort descriptors.

Take ( this source, int count ) : IQueryable

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

ToGridModel ( this queryable, Telerik.Web.Mvc.GridState state ) : Telerik.Web.Mvc.GridModel
ToGridModel ( this queryable, int page, int pageSize, IList sortDescriptors, IEnumerable filterDescriptors, IEnumerable groupDescriptors ) : Telerik.Web.Mvc.GridModel
ToGridModel ( this queryable, int page, int pageSize, string orderBy, string groupBy, string filter ) : Telerik.Web.Mvc.GridModel
ToGroupingGridModel ( this queryable, IEnumerable groupDescriptors, int totalCount ) : Telerik.Web.Mvc.GridModel
ToIList ( this source ) : IList

Creates a IList{T} from an IQueryable where T is IQueryable.ElementType.

Where ( this source, Expression predicate ) : IQueryable

Filters a sequence of values based on a predicate.

Where ( this source, IEnumerable filterDescriptors ) : IQueryable

Filters a sequence of values based on a collection of IFilterDescriptor.

Private Methods

Method Description
CallQueryableMethod ( this source, string methodName, LambdaExpression selector ) : IQueryable
IsBindableType ( Type type ) : bool
Ordered ( this source ) : IQueryable
SelectDistinct ( this source, Type propertyType, string propertyName ) : IQueryable

Method Details

Aggregate() public static method

Calculates the results of given aggregates functions on a sequence of elements.
public static Aggregate ( this source, IEnumerable aggregateFunctions ) : AggregateResultCollection
source this An whose elements will /// be used for aggregate calculation.
aggregateFunctions IEnumerable The aggregate functions.
return AggregateResultCollection

Count() public static method

Returns the number of elements in a sequence.
is null.
public static Count ( this source ) : int
source this /// The that contains the elements to be counted. ///
return int

ElementAt() public static method

Returns the element at a specified index in a sequence.
is null. is less than zero.
public static ElementAt ( this source, int index ) : object
source this An to return an element from.
index int The zero-based index of the element to retrieve.
return object

GroupBy() public static method

Groups the elements of a sequence according to a specified groupDescriptors.
public static GroupBy ( this source, IEnumerable groupDescriptors ) : IQueryable
source this An whose elements to group.
groupDescriptors IEnumerable The group descriptors used for grouping.
return IQueryable

GroupBy() public static method

Groups the elements of a sequence according to a specified key selector function.
public static GroupBy ( this source, LambdaExpression keySelector ) : IQueryable
source this An whose elements to group.
keySelector System.Linq.Expressions.LambdaExpression A function to extract the key for each element.
return IQueryable

OrderBy() public static method

Sorts the elements of a sequence in ascending order according to a key.
public static OrderBy ( this source, LambdaExpression keySelector ) : IQueryable
source this /// A sequence of values to order. ///
keySelector System.Linq.Expressions.LambdaExpression /// A function to extract a key from an element. ///
return IQueryable

OrderBy() public static method

Calls OrderBy(System.Linq.IQueryable,System.Linq.Expressions.LambdaExpression) or OrderByDescending depending on the sortDirection.
public static OrderBy ( this source, LambdaExpression keySelector, ListSortDirection sortDirection ) : IQueryable
source this The source.
keySelector System.Linq.Expressions.LambdaExpression The key selector.
sortDirection ListSortDirection The sort direction.
return IQueryable

OrderByDescending() public static method

Sorts the elements of a sequence in descending order according to a key.
public static OrderByDescending ( this source, LambdaExpression keySelector ) : IQueryable
source this /// A sequence of values to order. ///
keySelector System.Linq.Expressions.LambdaExpression /// A function to extract a key from an element. ///
return IQueryable

Page() public static method

Pages through the elements of a sequence until the specified pageIndex using pageSize.
public static Page ( this source, int pageIndex, int pageSize ) : IQueryable
source this A sequence of values to page.
pageIndex int Index of the page.
pageSize int Size of the page.
return IQueryable

Select() public static method

Projects each element of a sequence into a new form.
public static Select ( this source, LambdaExpression selector ) : IQueryable
source this A sequence of values to project.
selector System.Linq.Expressions.LambdaExpression A projection function to apply to each element.
return IQueryable

Skip() public static method

Bypasses a specified number of elements in a sequence and then returns the remaining elements.
is null.
public static Skip ( this source, int count ) : IQueryable
source this /// An to return elements from. ///
count int /// The number of elements to skip before returning the remaining elements. ///
return IQueryable

Sort() public static method

Sorts the elements of a sequence using the specified sort descriptors.
public static Sort ( this source, IEnumerable sortDescriptors ) : IQueryable
source this A sequence of values to sort.
sortDescriptors IEnumerable The sort descriptors used for sorting.
return IQueryable

Take() public static method

Returns a specified number of contiguous elements from the start of a sequence.
is null.
public static Take ( this source, int count ) : IQueryable
source this The sequence to return elements from.
count int The number of elements to return.
return IQueryable

ToGridModel() public static method

public static ToGridModel ( this queryable, Telerik.Web.Mvc.GridState state ) : Telerik.Web.Mvc.GridModel
queryable this
state Telerik.Web.Mvc.GridState
return Telerik.Web.Mvc.GridModel

ToGridModel() public static method

public static ToGridModel ( this queryable, int page, int pageSize, IList sortDescriptors, IEnumerable filterDescriptors, IEnumerable groupDescriptors ) : Telerik.Web.Mvc.GridModel
queryable this
page int
pageSize int
sortDescriptors IList
filterDescriptors IEnumerable
groupDescriptors IEnumerable
return Telerik.Web.Mvc.GridModel

ToGridModel() public static method

public static ToGridModel ( this queryable, int page, int pageSize, string orderBy, string groupBy, string filter ) : Telerik.Web.Mvc.GridModel
queryable this
page int
pageSize int
orderBy string
groupBy string
filter string
return Telerik.Web.Mvc.GridModel

ToGroupingGridModel() public static method

public static ToGroupingGridModel ( this queryable, IEnumerable groupDescriptors, int totalCount ) : Telerik.Web.Mvc.GridModel
queryable this
groupDescriptors IEnumerable
totalCount int
return Telerik.Web.Mvc.GridModel

ToIList() public static method

Creates a IList{T} from an IQueryable where T is IQueryable.ElementType.
/// is null. ///
public static ToIList ( this source ) : IList
source this /// The to create a from. ///
return IList

Where() public static method

Filters a sequence of values based on a predicate.
public static Where ( this source, Expression predicate ) : IQueryable
source this An to filter.
predicate System.Linq.Expressions.Expression A function to test each element for a condition.
return IQueryable

Where() public static method

Filters a sequence of values based on a collection of IFilterDescriptor.
public static Where ( this source, IEnumerable filterDescriptors ) : IQueryable
source this The source.
filterDescriptors IEnumerable The filter descriptors.
return IQueryable