Skip to content
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

Add enum and comparison translators for cosmos #35405

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cosmos: Translate Enum.HasFlag
1 participant