-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
groupby not working without NewtonsoftJson #2030
Comments
Any love for this issue folks? This is still a problem a year later. I've reproduced this in a much simplified example based on the excellent research by @keatkeat87 https://github.com/thesheps/groupby-issue This example has no dependency on Entity Framework at all, and has a reduced number of moving parts. If you spin this example up and hit:
You'll see the following error: If you uncomment line 16 of Startup.cs which enables Newtonsoft.Json, the example runs successfully BUT the response has any This makes me think there's something wrong in the underpinnings of the default OData serializer. Happy to get involved in devving a fix for this, but would love some guidance from the community! |
Funnily I have an error when enabling Newtonsoft and it works fine with system.text in class: CallStack:
|
This helped me with Newtonsoft: package in csproj:
|
error message :

Unable to cast object of type 'System.String' to type 'Microsoft.AspNet.OData.Query.Expressions.GroupByWrapper'.
when i add NewtonsoftJson to my project, this error gone.

Assemblies affected
asp.net core 3.1, odata 7.3 beta
Reproduce steps
1.git clone https://github.com/keatkeat87/odata-groupby-without-NewtonsoftJson.git
2.dotnet ef migrations add init
3.dotnet ef database update
4.F5
5.visit /odata/Products?$apply=groupby((category))
Expected result
it should work without NewtonsoftJson
Actual result
when not using NewtonsoftJson, error come out.
The text was updated successfully, but these errors were encountered: