kendo-labs / dlinq-helpers

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

ToDataSourceResult does not enable a function to bind to a VM #13

Open OoonaNet opened 9 years ago

OoonaNet commented 9 years ago

General

The Kendo.Mvc.Extensions ToDataSourceResult has an overload that enables a function to be called in order to bind the result to VM/DTO this overload is missing in Kendo.DynamicLinq where only 3 overloads exist.

Attempts to work around

I tried to use the Kendo.Mvc.Extensions but the filters and sorts don't match up. Using the Kendo.Mvc.Extensions made a huge improvement in performance as the DTO conversion was made after the data was filtered and sorted.

It will be great to have it. 10x

holwerda commented 8 years ago

Just wondering if this has been looked at or addressed. I keep seeing examples of this mapping functionality, but do not see it in the release.

bdongus commented 7 years ago

Ran into this just recently. My work around using AutoMapper: DataSourceResult retVal = result.ToDataSourceResult(request); retVal.Data = retVal.Data.OfType<RawData>().Select((raw) => _mapper.Map<ViewModel>(raw)ToList(); return retVal;