Under Review
Last Updated: 20 Mar 2019 11:47 by ADMIN
Mario
Created on: 13 Mar 2019 11:56
Category: UI for ASP.NET MVC
Type: Feature Request
0
"Kendo.Mvc.Extensions.QueryableExtensions" with DataSourceRequest should produce parameterized queries

When using QueryableExtensions.ToDataSourceResult() from Telerik MVC, SQL following gets produced:

.. FROM [RMP].[V_UC_EQUIPMENT_LOG2_LOCALIZATION] WHERE ([Extent1].[LOG_TIME] >= convert(DateTimeOffset, ''2019-03-05 23:00:00.0000000 +00:00'', 121)) AND ([Extent1].[LOG_CLASS_ID] IN (78,7,18,30,19,16,17))

When we filter manually in code with linq, e. g.

..  table.Where(e => e.T_EquiID == 234234) ...

the linq provider produces a parameterized query as follows:

AND (@p__linq__0 = [Extent1].[T_EquiID])...

 

When using a parameterized query, Sql Server can reuse the execution plan much better saving compile time, which is in our case sometimes a big issue.

Please tell us, why can QueryExtensions do produce parameterized queries.

1 comment
ADMIN
Konstantin Dikov
Posted on: 20 Mar 2019 11:47
Hi Mario,

We will definitely look into this and see if there could be an option for extending the ToDataSourceResult method, but meanwhile you could take a look at the following forum thread and the suggested custom implementation:
I could also suggest the Custom AJAX Binding, which gives the developer the freedom to retrieve the data manually:
Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.