Kendo.Mvc.Extensions.QueryableExtensions
Provides extension methods to process DataSourceRequest.
Methods
ToDataSourceResult(System.Data.DataTable,Kendo.Mvc.UI.DataSourceRequest)
Applies paging, sorting, filtering and grouping using the information from the DataSourceRequest object. If the collection is already paged, the method returns an empty resullt.
Parameters
dataTable System.Data.DataTable
An instance of DataTable.
request Kendo.Mvc.UI.DataSourceRequest
An instance of DataSourceRequest.
Returns
A DataSourceResult object, which contains the processed data after paging, sorting, filtering and grouping are applied.
ToDataSourceResultAsync(System.Data.DataTable,Kendo.Mvc.UI.DataSourceRequest)
Applies paging, sorting, filtering and grouping using the information from the DataSourceRequest object. If the collection is already paged, the method returns an empty resullt.
Parameters
dataTable System.Data.DataTable
An instance of DataTable.
request Kendo.Mvc.UI.DataSourceRequest
An instance of DataSourceRequest.
Returns
A Task of DataSourceResult object, which contains the processed data after paging, sorting, filtering and grouping are applied. It can be called with the "await" keyword for asynchronous operation.
ToDataSourceResult(System.Collections.IEnumerable,Kendo.Mvc.UI.DataSourceRequest)
Applies paging, sorting, filtering and grouping using the information from the DataSourceRequest object. If the collection is already paged, the method returns an empty result.
Parameters
enumerable System.Collections.IEnumerable
An instance of IEnumerable.
request Kendo.Mvc.UI.DataSourceRequest
An instance of DataSourceRequest.
Returns
A DataSourceResult object, which contains the processed data after paging, sorting, filtering and grouping are applied.
ToDataSourceResultAsync(System.Collections.IEnumerable,Kendo.Mvc.UI.DataSourceRequest)
Applies paging, sorting, filtering and grouping using the information from the DataSourceRequest object. If the collection is already paged, the method returns an empty result.
Parameters
enumerable System.Collections.IEnumerable
An instance of IEnumerable.
request Kendo.Mvc.UI.DataSourceRequest
An instance of DataSourceRequest.
Returns
A Task of DataSourceResult object, which contains the processed data after paging, sorting, filtering and grouping are applied. It can be called with the "await" keyword for asynchronous operation.
ToDataSourceResult(System.Linq.IQueryable,Kendo.Mvc.UI.DataSourceRequest)
Applies paging, sorting, filtering and grouping using the information from the DataSourceRequest object. If the collection is already paged, the method returns an empty result.
Parameters
queryable System.Linq.IQueryable
An instance of IQueryable.
request Kendo.Mvc.UI.DataSourceRequest
An instance of DataSourceRequest.
Returns
A DataSourceResult object, which contains the processed data after paging, sorting, filtering and grouping are applied.
ToDataSourceResultAsync(System.Linq.IQueryable,Kendo.Mvc.UI.DataSourceRequest)
Applies paging, sorting, filtering and grouping using the information from the DataSourceRequest object. If the collection is already paged, the method returns an empty result.
Parameters
queryable System.Linq.IQueryable
An instance of IQueryable.
request Kendo.Mvc.UI.DataSourceRequest
An instance of DataSourceRequest.
Returns
A Task of DataSourceResult object, which contains the processed data after paging, sorting, filtering and grouping are applied. It can be called with the "await" keyword for asynchronous operation.
Sort(System.Linq.IQueryable,System.Collections.Generic.IEnumerable<Kendo.Mvc.SortDescriptor>)
Sorts the elements of a sequence using the specified sort descriptors.
Parameters
source System.Linq.IQueryable
A sequence of values to sort.
sortDescriptors System.Collections.Generic.IEnumerable<Kendo.Mvc.SortDescriptor>
The sort descriptors used for sorting.
Returns
An IQueryable whose elements are sorted according to a .
Page(System.Linq.IQueryable,System.Int32,System.Int32)
Pages through the elements of a sequence until the specified using .
Parameters
source System.Linq.IQueryable
A sequence of values to page.
pageIndex System.Int32
Index of the page.
pageSize System.Int32
Size of the page.
Returns
An IQueryable whose elements are at the specified .
Select(System.Linq.IQueryable,System.Linq.Expressions.LambdaExpression)
Projects each element of a sequence into a new form.
Parameters
source System.Linq.IQueryable
A sequence of values to project.
selector System.Linq.Expressions.LambdaExpression
A projection function to apply to each element.
Returns
An IQueryable whose elements are the result of invoking a projection selector on each element of .
GroupBy(System.Linq.IQueryable,System.Linq.Expressions.LambdaExpression)
Groups the elements of a sequence according to a specified key selector function.
Parameters
source System.Linq.IQueryable
An IQueryable whose elements to group.
keySelector System.Linq.Expressions.LambdaExpression
A function to extract the key for each element.
Returns
An IQueryable with 2 items, whose elements contains a sequence of objects and a key.
OrderBy(System.Linq.IQueryable,System.Linq.Expressions.LambdaExpression)
Sorts the elements of a sequence in ascending order according to a key.
Parameters
source System.Linq.IQueryable
A sequence of values to order.
keySelector System.Linq.Expressions.LambdaExpression
A function to extract a key from an element.
Returns
An IQueryable whose elements are sorted according to a key.
OrderByDescending(System.Linq.IQueryable,System.Linq.Expressions.LambdaExpression)
Sorts the elements of a sequence in descending order according to a key.
Parameters
source System.Linq.IQueryable
A sequence of values to order.
keySelector System.Linq.Expressions.LambdaExpression
A function to extract a key from an element.
Returns
An IQueryable whose elements are sorted in descending order according to a key.
OrderBy(System.Linq.IQueryable,System.Linq.Expressions.LambdaExpression,System.Nullable<Kendo.Mvc.ListSortDirection>)
Calls M:Kendo.Mvc.Extensions.QueryableExtensions.OrderBy(System.Linq.IQueryable,System.Linq.Expressions.LambdaExpression) or M:Kendo.Mvc.Extensions.QueryableExtensions.OrderByDescending(System.Linq.IQueryable,System.Linq.Expressions.LambdaExpression) depending on the .
Parameters
source System.Linq.IQueryable
The source.
keySelector System.Linq.Expressions.LambdaExpression
The key selector.
sortDirection System.Nullable<Kendo.Mvc.ListSortDirection>
The sort direction.
Returns
An IQueryable whose elements are sorted according to a key.
GroupBy(System.Linq.IQueryable,System.Collections.Generic.IEnumerable<Kendo.Mvc.GroupDescriptor>,System.Boolean)
Groups the elements of a sequence according to a specified .
Parameters
source System.Linq.IQueryable
An IQueryable whose elements to group.
groupDescriptors System.Collections.Generic.IEnumerable<Kendo.Mvc.GroupDescriptor>
The group descriptors used for grouping.
Returns
An IQueryable with IGroup items, whose elements contains a sequence of objects and a key.
Aggregate(System.Linq.IQueryable,System.Collections.Generic.IEnumerable<Kendo.Mvc.AggregateFunction>)
Calculates the results of given aggregates functions on a sequence of elements.
Parameters
source System.Linq.IQueryable
An IQueryable whose elements will be used for aggregate calculation.
aggregateFunctions System.Collections.Generic.IEnumerable<Kendo.Mvc.AggregateFunction>
The aggregate functions.
Returns
Collection of AggregateResults calculated for each function.
Where(System.Linq.IQueryable,System.Linq.Expressions.Expression)
Filters a sequence of values based on a predicate.
Parameters
source System.Linq.IQueryable
An IQueryable to filter.
predicate System.Linq.Expressions.Expression
A function to test each element for a condition.
Returns
An IQueryable that contains elements from the input sequence that satisfy the condition specified by .
Where(System.Linq.IQueryable,System.Collections.Generic.IEnumerable<Kendo.Mvc.IFilterDescriptor>)
Filters a sequence of values based on a collection of IFilterDescriptor.
Parameters
source System.Linq.IQueryable
The source.
filterDescriptors System.Collections.Generic.IEnumerable<Kendo.Mvc.IFilterDescriptor>
The filter descriptors.
Returns
An IQueryable that contains elements from the input sequence that satisfy the conditions specified by each filter descriptor in .
Take(System.Linq.IQueryable,System.Int32)
Returns a specified number of contiguous elements from the start of a sequence.
Parameters
source System.Linq.IQueryable
The sequence to return elements from.
count System.Int32
The number of elements to return.
Returns
An IQueryable that contains the specified number of elements from the start of .
Skip(System.Linq.IQueryable,System.Int32)
Bypasses a specified number of elements in a sequence and then returns the remaining elements.
Parameters
source System.Linq.IQueryable
An IQueryable to return elements from.
count System.Int32
The number of elements to skip before returning the remaining elements.
Returns
An IQueryable that contains elements that occur after the specified index in the input sequence.
Count(System.Linq.IQueryable)
Returns the number of elements in a sequence.
Parameters
source System.Linq.IQueryable
The IQueryable that contains the elements to be counted.
Returns
The number of elements in the input sequence.
ElementAt(System.Linq.IQueryable,System.Int32)
Returns the element at a specified index in a sequence.
Parameters
source System.Linq.IQueryable
An IQueryable to return an element from.
index System.Int32
The zero-based index of the element to retrieve.
Returns
The element at the specified position in .
Union(System.Linq.IQueryable,System.Linq.IQueryable)
Produces the set union of two sequences by using the default equality comparer.
Parameters
source System.Linq.IQueryable
An IQueryable whose distinct elements form the first set for the union.
second System.Linq.IQueryable
An IQueryable whose distinct elements form the first set for the union.
Returns
An IQueryable that contains the elements from both input sequences, excluding duplicates.
ToTreeDataSourceResult(System.Collections.IEnumerable,Kendo.Mvc.UI.DataSourceRequest)
Applies sorting, filtering and grouping using the information from the DataSourceRequest object. If the collection is already paged, the method returns an empty result.
Parameters
enumerable System.Collections.IEnumerable
An instance of IEnumerable.
request Kendo.Mvc.UI.DataSourceRequest
An instance of DataSourceRequest.
Returns
A TreeDataSourceResult object, which contains the processed data after sorting, filtering and grouping are applied.
ToTreeDataSourceResultAsync(System.Collections.IEnumerable,Kendo.Mvc.UI.DataSourceRequest)
Applies sorting, filtering and grouping using the information from the DataSourceRequest object. If the collection is already paged, the method returns an empty result.
Parameters
enumerable System.Collections.IEnumerable
An instance of IEnumerable.
request Kendo.Mvc.UI.DataSourceRequest
An instance of DataSourceRequest.
Returns
A Task of TreeDataSourceResult object, which contains the processed data after sorting, filtering and grouping are applied. It can be called with the "await" keyword for asynchronous operation.