InvalidOperationException on $apply query from EF Core
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 505
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the $apply=aggregate($count as OrderCount) request and the controller's queryOptions.ApplyTo(query) call. Reproduce the InvalidOperationException against EF Core using the Student query, then determine whether the failure is a bug or a limitation and document the result or identify the affected query-processing path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100