You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue occurs in Microsoft.AspNetCore.OData versions starting from 8.0.5 and up to 9.2.0. The last known working version is 8.0.4.
Describe the bug
A regression occurs when using $apply=compute in OData queries. The query that worked in Microsoft.AspNetCore.OData version 8.0.4 now fails in versions 8.0.5 and later. The error indicates that the model does not contain the type Microsoft.AspNetCore.OData.Query.Wrapper.ComputeWrapper.
This issue is critical because our clients actively rely on $apply=compute queries in production environments, and the inability to use this functionality disrupts their workflows.
Reproduce steps
Create a new ASP.NET Core Web API project with OData setup.
Add the Microsoft.AspNetCore.OData NuGet package version 8.0.4.
With Microsoft.AspNetCore.OData version 8.0.5 or later (9.2.0):
{
"error": {
"code": "",
"message": "The query specified in the URI is not valid. The given model does not contain the type 'Microsoft.AspNetCore.OData.Query.Wrapper.ComputeWrapper`1[[MyEntity, MyODataProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'.",
"details": [],
"innererror": {
"message": "The given model does not contain the type 'Microsoft.AspNetCore.OData.Query.Wrapper.ComputeWrapper`1[[MyEntity, MyODataProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'.",
"type": "Microsoft.OData.ODataException",
"stacktrace": " at Microsoft.AspNetCore.OData.Query.Expressions.QueryBinderContext..ctor(IEdmModel model, ODataQuerySettings querySettings, Type clrType)\r\n at ..."
}
}
}
Expected behavior
The query $apply=compute should work as expected, similar to how it works in version 8.0.4. The response should include the computed field (comp) based on the substring function.
Additional context
The issue appears to be related to how ComputeWrapper is handled in the OData library starting from version 8.0.5.
Rolling back to version 8.0.4 resolves the issue.
This issue is critical because our clients actively rely on $apply=compute queries in production environments. Fixing this regression is essential to ensure their workflows are not disrupted.
The text was updated successfully, but these errors were encountered:
Hi @marabooy, yes, the query with $compute directly works. However, we have many clients relying on the $apply=compute format in their workflows. Compatibility with the old query format is crucial for us to avoid disruptions in production environments.
Assemblies affected
The issue occurs in
Microsoft.AspNetCore.OData
versions starting from8.0.5
and up to9.2.0
. The last known working version is8.0.4
.Describe the bug
A regression occurs when using
$apply=compute
in OData queries. The query that worked inMicrosoft.AspNetCore.OData
version8.0.4
now fails in versions8.0.5
and later. The error indicates that the model does not contain the typeMicrosoft.AspNetCore.OData.Query.Wrapper.ComputeWrapper
.This issue is critical because our clients actively rely on
$apply=compute
queries in production environments, and the inability to use this functionality disrupts their workflows.Reproduce steps
Microsoft.AspNetCore.OData
NuGet package version8.0.4
.Program.cs
:Microsoft.AspNetCore.OData
version8.0.4
:Microsoft.AspNetCore.OData
version8.0.5
or later (9.2.0
):Expected behavior
The query
$apply=compute
should work as expected, similar to how it works in version8.0.4
. The response should include the computed field (comp
) based on thesubstring
function.Additional context
ComputeWrapper
is handled in the OData library starting from version8.0.5
.8.0.4
resolves the issue.$apply=compute
queries in production environments. Fixing this regression is essential to ensure their workflows are not disrupted.The text was updated successfully, but these errors were encountered: