I am using QueryableCollectionView (QCV) together with EF Core 3.1.2 as a datasource for RadGridView. As soon as I set an AggregateFunctions on a DataColumn in my grid EF Core throws an error:
System.InvalidOperationException
HResult=0x80131509
Message= Processing of the LINQ expression '(GroupByShaperExpression:
KeySelector: (1),
ElementSelector:(EntityShaperExpression:
EntityType: SalesOrderHeader
ValueBufferExpression:
(ProjectionBindingExpression: EmptyProjectionMember)
IsNullable: False
)
)' by 'RelationalProjectionBindingExpressionVisitor' failed. This may indicate either a bug or a limitation in EF Core. See https://go.microsoft.com/fwlink/?linkid=2101433 for more detailed information.
Source= Microsoft.EntityFrameworkCore.Relational
I consider this as a serious bug. The way EF Core 3.x supports query evaluation has changed drastically compared to former versions (as mentioned in the link inside the error message) and it seems that Telerik's query building is not taken this fact into account.
It is quite simple to reproduce the error:
1. Create a .NET Core 3 WPF project with Telerik.UI.for.Wpf.NetCore 2020.1.218
2. Add EF Core 3.1.x package
3. Create a DbContext with just one table (which is enough to reproduce the error)
4. Create a QCV from the table
5. Place a RadGridView and bind it to the QCV
Everything should work as expected. Now place an AggregateFunction like CountFunction on one DataColumn and you should see the error. There is also a similar issue in this thread:
https://www.telerik.com/forums/todatasource-throws-exception-using-ef-core-3-0-with-groups
At the moment I am migrating a WPF application from .NET 4.6.1 to .NET Core 3 and I rely heavily on QCV. I would be very grateful for any help!
Regards
Heiko