We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
ExpressionToSQL::VisitBinary does not support string.Compare, only CompareTo
string.Compare
CompareTo
We're using the Microsoft.OData.Core nuget package to project OData queries into CosmosDB.
The Microsoft.OData.Core nuget package generates expressions with string.Compare
To Reproduce
We can reproduce without the OData dependency.
We have an IQueryable that fails with a Where clause like this:
IQueryable
Where
.Where(m => string.Compare(m.Id, "hello") == 0)
However, it works if we do:
.Where(m => m.Id.CompareTo("hello") == 0);
Expected behavior
The SDK should generate valid SQL similar to
Id = "hello"
Actual behavior
The SDK throws an exception of type DocumentQueryException with the message "Method 'Compare' is not supported."
DocumentQueryException
Environment summary SDK Version: 3.20.1 OS Version (e.g. Windows, Linux, MacOSX): MacOS, Linux
Additional context
The text was updated successfully, but these errors were encountered:
@j82w we patched this feature on a fork and would love to commit it back to the main line. Let us know how best we can engage.
Sorry, something went wrong.
@kylemc is there anything blocking you from sending a PR? You should be able to create a PR from the fork.
@kylemc Any updates? I'm having the same problem while using
_container.GetItemLinqQueryable<SomeEntity>().Where(x => string.Compare(x.Id, "something", StringComparison.Ordinal) == 0)
Successfully merging a pull request may close this issue.
Describe the bug
ExpressionToSQL::VisitBinary does not support
string.Compare
, onlyCompareTo
We're using the Microsoft.OData.Core nuget package to project OData queries into CosmosDB.
The Microsoft.OData.Core nuget package generates expressions with
string.Compare
To Reproduce
We can reproduce without the OData dependency.
We have an
IQueryable
that fails with aWhere
clause like this:However, it works if we do:
Expected behavior
The SDK should generate valid SQL similar to
Actual behavior
The SDK throws an exception of type
DocumentQueryException
with the message "Method 'Compare' is not supported."Environment summary
SDK Version: 3.20.1
OS Version (e.g. Windows, Linux, MacOSX): MacOS, Linux
Additional context
The text was updated successfully, but these errors were encountered: