Completed
Last Updated: 06 Jul 2020 12:32 by ADMIN
Release LIB 2020.2.713
Vladimir
Created on: 16 Mar 2020 14:47
Category: GridView
Type: Bug Report
2
GridView: System.InvalidOperationException is thrown when adding an AggregateFunction and using Entity Framework Core 3
When using Entity Framework Core 3 an InvalidOperationException is received upon adding an AggregateFunction to a column. 
4 comments
ADMIN
Vladimir Stoyanov
Posted on: 20 Mar 2020 14:49

Hello Heiko,

Thank you for the update. 

You are correct that the listed operators are supported, however there is still a GroupBy that cannot be translated. The internal data engine of the RadGridView uses a GroupBy query when processing the aggregate function results. 

Regards,
Vladimir Stoyanov
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.
Heiko
Posted on: 18 Mar 2020 15:10

Hello Vladimir,

this is only partly true. Read this:

The aggregate operators EF Core supports are as follows

  • Average
  • Count
  • LongCount
  • Max
  • Min
  • Sum

Found here: https://docs.microsoft.com/en-us/ef/core/querying/complex-query-operators#groupby

So at least a simple "Count" should work as expected, and that is what I am using:

<telerik:GridViewDataColumn.AggregateFunctions>
    <telerik:CountFunction Caption="Count: " />
</telerik:GridViewDataColumn.AggregateFunctions>

 

Regards
Heiko

ADMIN
Vladimir Stoyanov
Posted on: 18 Mar 2020 14:51

Hello Heiko,

We reviewed the described scenario, however the exception comes from the fact that the Entity Framework Core 3 library does not Support GroupBy. Note, that when adding an AggregateFunction a GroupBy query is created. With this in mind, you can follow the github issue in order to get notified for any developments. If the GroupBy translation is implemented in a future version of Entity Framework Core, you should not observe the mentioned exception. 

For the time being, I can either suggest downgrading to an earlier version of Entity Framework Core, where the GroupBy query would be evaluated on the client or calling ToList when accessing the data. 

Regards,
Vladimir Stoyanov
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.
Heiko
Posted on: 16 Mar 2020 15:50

See this forum thread where I explain the cause in detail:

 

https://www.telerik.com/forums/queryablecollectionview-and-ef-core-3-x