-
Notifications
You must be signed in to change notification settings - Fork 158
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
Adding a condition to cast QueryNode
to SingleResourceCastNode
for Unquoted Type Parameter
#1313
Conversation
eeb83f5
to
3d27793
Compare
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/FakeEdmNodesHelper.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/HardCodedTestModel.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/QueryBinderTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/QueryBinderTests.cs
Outdated
Show resolved
Hide resolved
left comments and approve for others. |
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/QueryBinderTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/QueryBinderTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/QueryBinderTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to see a test with an actual "unquoted" type parameter in a cast expression in the query options of a URL. Or is that already handled elsewhere?
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/QueryBinderTests.cs
Outdated
Show resolved
Hide resolved
Currently, |
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/QueryBinderTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/QueryBinderTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/QueryBinderTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/QueryBinderTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/QueryBinderTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/QueryBinderTests.cs
Outdated
Show resolved
Hide resolved
…r Unquoted Type Parameter (#1313) * Cast queryNode to SingleResourceCastNode as well * Added tests for both ConstantNode and SingleResourceCastNode
Issues
This pull request fixes #1304.
Description
This modification adds a condition to cast
QueryNode
toSingleResourceCastNode
.Currently, the QueryNode is only converted to
ConstantNode
and supports thecast
function only with quoted type parameters. For unquoted type parameters, the QueryNode will be of typeSingleResourceCastNode
, resulting in an error becauseSingleResourceCastNode
cannot be cast toConstantNode
.For example, given the following entities:
With this change, we should be able to support these
cast
s with unquoted type parameters:cast(NS.Employee)
: cast Person to Employeecast(Location, NS.WorkAddress)
: cast Location property to NS.WorkAddressChecklist (Uncheck if it is not completed)
Additional work necessary
If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.