EqualsMethodToAggregationExpressionTranslator considers StringComparison.CurrentCulture and StringComparison.Ordinal to be equivalent. StartsWithContainsOrEndsWithMethodToAggregationExpressionTranslator considers StringComparison.CurrentCulture to be supported and all other StringComparison values throw ExpressionNotSupportedException. We should review our uses of StringComparison to ensure that they are consistent across the driver.
Note that neither CurrentCulture nor Ordinal truly captures the server semantics. The server does not have an equivalent to Ordinal. Even CurrentCulture isn't quite right as many server functions such as $toLower only have well-defined behaviours for strings of ASCII characters. So we will have to make a design decision regarding how best to represent StringComparison values when translating to MQL or whether we should throw ExpressionNotSupportedExceptions.
- is duplicated by
-
CSHARP-4115 Query against strings (case insensitive)
- Backlog
- split to
-
CSHARP-4119 Review Compare, CompareTo and Equals uses of StringComparison, CultureInfo and ignoreCase
- Backlog
-
CSHARP-4120 Review IndexOf and LastIndexOf uses of StringComparison
- Backlog
-
CSHARP-4121 Review ToLower and ToUpper uses of CultureInfo
- Backlog