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

Support translating some string functions when they have a char parameters #34999

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

Conversation

ChrisJollyAU
Copy link
Contributor

Translate string functions that also take a char as a parameter.

Adds support for the following to also have a char parameter in addition to the currently supported string parameter.

  • StartsWith
  • EndsWith
  • Contains
  • Replace
  • IndexOf

Comes in handy when you are following some code suggestions, and you get this one https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1865-ca1867

Most translations are just an extension of the current string parameter version - just match the right method and handle the char version with the right type mapping.

Also Indexof_with_constant_starting_position and Indexof_with_parameter_starting_position are now successfully translated for sqlite

This fixes #32482

@ChrisJollyAU ChrisJollyAU requested a review from a team as a code owner October 28, 2024 13:49
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.

StartsWith(char) can't be used with EF Core 8
2 participants