This is a migrated thread and some comments may be shown as answers.

QueryableCollectionView and EF Core 3.x

1 Answer 263 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Heiko
Top achievements
Rank 1
Iron
Veteran
Heiko asked on 12 Mar 2020, 04:41 PM

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

 

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 16 Mar 2020, 02:59 PM

Hello Heiko,

Thank you for the provided information. 

I was able to reproduce the described scenario and I have logged it in our feedback portal, where you can track its progress: GridView: System.InvalidOperationException is thrown when adding an AggregateFunction and using Entity Framework Core 3. I have also added some telerik points to your account as a thank you for bringing this to our attention. 

I am afraid that I cannot suggest a workaround for the time being except switching to an earlier version of Entity Framework Core (2.x).

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.
Tags
General Discussions
Asked by
Heiko
Top achievements
Rank 1
Iron
Veteran
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or