-
Notifications
You must be signed in to change notification settings - Fork 491
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
Linq expression on Nullable<T>.HasValue does not work when using camelCase serialization #2916
Comments
@jackbond there has been some discussion about this behavior over at #2248 but for now this is the behavior of the SDK, and since the |
The implementation is |
Describe the bug
Due to the logic in ExpressionToSQL, when
camelCase
serialization is enabled,Nullable<T>.HasValue
does not translate to IS_DEFINED, and instead translates to ["hasValue"] in query text.azure-cosmos-dotnet-v3/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs
Lines 737 to 756 in df040f3
To Reproduce
Steps to reproduce the behavior. If you can include code snippets or links to repositories containing a repro of the issue that can helps us in detecting the scenario it would speed up the resolution.
Expected behavior
Query is
SELECT VALUE root FROM root WHERE ((NOT IS_DEFINED(root["NullableValue"])) OR (root["NullableValue"] = null))
Actual behavior
Query is
SELECT VALUE root FROM root WHERE ((NOT root["nullableValue"]["hasValue"]) OR (root["nullableValue"] = null))
Environment summary
SDK Version: 3.23
OS Version (e.g. Windows, Linux, MacOSX) Windows
Additional context
N/A
The text was updated successfully, but these errors were encountered: