Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension method with DataSourceRequest parameter added for "ToDataSourceResultAsync" #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/QueryableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ public static Task<DataSourceResult> ToDataSourceResultAsync<T>(this IQueryable<
return Task.Run(() => queryable.ToDataSourceResult(take, skip, sort, filter, aggregates, group));
}

/// <summary>
/// Asynchronously applies data processing (paging, sorting, filtering and aggregates) over IQueryable using Dynamic Linq.
/// </summary>
/// <typeparam name="T">The type of the IQueryable.</typeparam>
/// <param name="queryable">The IQueryable which should be processed.</param>
/// <param name="dataSourceRequest">Specifies Kendo DataSourceRequest.</param>
/// <returns>A DataSourceResult object populated from the processed IQueryable.</returns>
public static Task<DataSourceResult> ToDataSourceResultAsync<T>(this IQueryable<T> queryable, DataSourceRequest dataSourceRequest)
{
return Task.Run(() => queryable.ToDataSourceResult(dataSourceRequest));
}

private static IQueryable<T> Filters<T>(IQueryable<T> queryable, Filter filter, List<object> errors)
{
if (filter?.Logic != null)
Expand Down