Skip to content

Conversation

ChrisJollyAU
Copy link
Contributor

Adds the EnumMethod and Comparison translators to Cosmos.

  • This supports the enum HasFlag and ToString
  • Also adds .CompareTo (in comparison)

The above translators are almost the same as the relational version.

With the expressions, I needed to add in the CaseExpression which is straight from the relational version (easier if it ends up both having a common base in the future).

Query sql generator: Ouputs an IIF statement when processing a CaseExpression

Moved the respective tests to the new test classes.

Making this a draft as some of the enum ToString tests don't work yet. The below line (71) currently only returns null whereas in relational it is a unary convert node. I suspect if combined with #35000 that should be fine after that

_sqlExpressionFactory.Convert(instance, typeof(string))

Fixes #35317
Also continues #17246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cosmos: Translate Enum.HasFlag
3 participants