-
Notifications
You must be signed in to change notification settings - Fork 159
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
Problem when $apply is combined with other query options like $filter and $orderby #939
Comments
@imoraca This issue was fixed by this PR: #919. We'll do a new release soon with the changes. You can also look at this answer in regards to the introduced dynamic properties: #420 (comment) |
@ElizabethOkerio I'm a little bit confused about the next release. Using VS2022 I've downloaded Microsoft.AspNetCore.OData using Nuget Manager (Package source: nuget.org) and as I can see the latest stable version is 8.2.0 But, here on GitHub, the latest release is 8.1.2 How come nuget.org has version 8.2.0 while here on github the latest stable release is 8.1.2 Why isn't this synchronized and what will be the number of the next release? |
@imoraca we've synchronized the GitHub release with the nuget release. |
Version 8.2.0 is still giving the same error. It looks like that dynamic properties introduced in the $apply are not available for later query options. (Look at my original comment). Examples that reproduce the error:
Will this be fixed in future versions? |
The fix for $apply with $filter will be in future versions. You can test with the main branch though and see whether the issue still persists. For the dynamic properties, did you look at this comment? #420 (comment). |
@ElizabethOkerio Yes, I've looked at comment #420 (comment) and I totally agree. In my example groupby transformation in $apply includes a property from the input data set, but that property is still not available for subsequent transformations or other query options. Examples:
This is still an issue with version 8.2.0 Can this issue be reopened or should I open the new one? |
Create a new issue for better tracking. |
Assemblies affected
Microsoft.AspNetCore.OData v 8.2.0 (Problem persists since v 8.0.5)
Describe the bug
When $apply is combined with $filter or $orderby an error occurs. $apply should be evaluated first, so all dynamic properties introduced in the $apply should be available for later query options. However this doesn't seem to work.
Example
In both cases I receive the following error:
The binary operator GreaterThan is not defined for the types 'System.Object' and 'System.Nullable`1[System.Decimal]'
When I try to combine $apply and $order I also get an error:
This time the error is:
Could not find a property named 'Total' on type 'AggregationSample.Models.Order'
Data Model
EDM (CSDL) Model
These queries use to work prior to ver. 8.0.5. Is there any workaround for this and will it be fixed in future versions?
The text was updated successfully, but these errors were encountered: