Dynamic LINQ and Kendo MVC wrappers

dynamic-linq entity-framework kendo-asp.net-mvc

Question

I'm using System.Linq.Dynamic.Core and EntityFramework library to generate a query like this:

var q = context.Items.Select("new(SomeProperty)")

The q is of type IQueryable at the moment. I can successfully apply OrderBy, Take, Skip and then execute the query.

But if I try to use the extension method from Kendo, things go south:

var results = q.ToDataSourceResult(new DataSourceRequest())

I get an Exception:

NotSupportedException

Unknown LINQ expression of type 'Dynamic'.

I know that the ToDataSourceResult method adds the OrderBy, Take and Skip to the IQueryable to do the paging so that's the most likely source of the problem (it does create a dynamic expression if the object is object or IDynamicMetaObjectProvider)

Any idea how to workaround this?

1
0
10/11/2017 9:35:39 AM

Popular Answer

You could also try this package https://github.com/StefH/KendoGridBinderEx which is created for Kendo Grid queries and uses System.Linq.Dynamic.Core

0
1/13/2018 11:49:54 AM


Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow