kendo-labs / dlinq-helpers

Add server paging, filtering and sorting via Dynamic Linq
71 stars 70 forks source link

Add DataSourceRequest and implement overload on ToDataSourceResult. #11

Closed ralphhendriks closed 10 years ago

ralphhendriks commented 10 years ago

I have added a DataSourceRequest POCO to simplify the obvious use of the DLinq Helpers in ASP.NET Web API (and maybe also ASP.NET MVC by using appropriate model binding). This simplifies the use on Web API controllers to:

[HttpPost]
public IHttpActionResult GetMyResources(DataSourceRequest request)
{
    var myResources = _repository.GetAll;
    return Ok(myResources.ToDataSourceResult(request));
}

Just a shortcut to prevent mapping out the take, skip, order, and filter parameters and passing them one-on-one to the ToDataSourceResult extension method.

akorchev commented 10 years ago

Thanks!