I'm upgrading OData and EF Core to 7.3.0 and 3.1. After doing so, i'm seeing new errors when trying to get a groupBy working. The same request did work before.
I wasn't sure if i should open an issue here or on EF Core github. If i'm wrong feel free to tell me and i'll move it.
The request that fails for me is : $apply=groupby((Actif))
Microsoft.AspNetCore.OData 7.3.0
Microsoft.EntityFrameworkCore 3.1.0
Get a project running with EF Core 3.1 and OData 7.3.0
The result of the groupBy
Exception is thrown :
An unhandled exception has occurred while executing the request.
System.InvalidCastException: Unable to cast object of type 'System.Boolean' to type 'Microsoft.AspNet.OData.Query.Expressions.GroupByWrapper'.
at get_NestedValue(Object )
at System.Text.Json.JsonPropertyInfoCommon4.GetValueAsObject(Object obj)
at System.Text.Json.JsonSerializer.Write(Utf8JsonWriter writer, Int32 originalWriterDepth, Int32 flushThreshold, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.JsonSerializer.WriteAsyncCore(Stream utf8Json, Object value, Type inputType, JsonSerializerOptions options, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
at Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor.ExecuteAsyncEnumerable(ActionContext context, ObjectResult result, IAsyncEnumerable1 asyncEnumerable)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNextTFilter,TFilterAsync
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.
@kosinsky Can you please take a look this issue and provide your suggestion?
EF Core and aggregations has some limitations. That one is fixable on OData side. However, we still need to do proper compatibility testing
Any news about this ?
Most helpful comment
Any news about this ?