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
$this ... It refers to the current instance of the collection.
While $this seems to be supported it is not mentioned anywhere, and $it seems like an alias for it (in fact they produce identical resuls), while it should be totally different.
In the end $it should only refer to the root collection/element which is the one represented by the resource path.
The text was updated successfully, but these errors were encountered:
We need to make sure that we introduce a compatibility flag so that customer clients who are perhaps misusing $it or $this are not going to be broken as a result of the fix.
Hello, @Xriuk
I tried to reproduce the issue, but it seems it works fine at my side. Let me share what I did and hope you can find the gap or maybe you can share a reproduce for me to dig more.
I think that
$it
meaning is misenterpreted in the current implementation.From the specs (5.1.1.14.4) (emphasis mine):
And the examples clarify that well:
Here
$it
refers to the current element of the primitive collection resource "EmailAddresses"And here
$it
refers to the current Customer entity of the entity set resource "Customers"However if I use the second URL I get the following error:
So it seems that it treats
$it
as the element of the current collection, which is what$this
is supposed to be for.This also happens for complex collection properties.
This is backed by the following blog post: https://devblogs.microsoft.com/odata/select-enhancement-in-asp-net-core-odata/
Which also uses
$it
wrongly in all the examples instead of$this
.Also from the specs (5.1.1.14.6):
While
$this
seems to be supported it is not mentioned anywhere, and$it
seems like an alias for it (in fact they produce identical resuls), while it should be totally different.In the end
$it
should only refer to the root collection/element which is the one represented by the resource path.The text was updated successfully, but these errors were encountered: