AspNetCoreOData icon indicating copy to clipboard operation
AspNetCoreOData copied to clipboard

InvalidOperationException on $apply query from EF Core

Open komdil opened this issue 4 years ago • 2 comments

I am getting this expection on $apply query: System.InvalidOperationException HResult=0x80131509 Message=Processing of the LINQ expression 'GroupByShaperExpression: KeySelector: new NoGroupByWrapper(), ElementSelector:EntityShaperExpression: EntityType: Student ValueBufferExpression: ProjectionBindingExpression: EmptyProjectionMember IsNullable: False ' by 'RelationalProjectionBindingExpressionVisitor' failed. This may indicate either a bug or a limitation in Entity Framework. See https://go.microsoft.com/fwlink/?linkid=2101433 for more detailed information. Source=Microsoft.EntityFrameworkCore.Relational

It is happening when I use $apply to query from ef core. Here is example of query: https://localhost:44383/Student?$apply=aggregate($count as OrderCount)

Here is controller:

var query = MyDBContext.Set<Student>().AsQueryable();
var res = queryOptions.ApplyTo(query);

My project is in .NET 5

komdil avatar May 24 '21 09:05 komdil

Any comments?

komdil avatar Jan 10 '22 08:01 komdil

Hi guys, is there any updates/suggestions?

MirolimMajidov avatar Aug 29 '23 05:08 MirolimMajidov