-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Query: SQL LIKE statement (wildcards) using LINQ #6159
Comments
Related to #2850. |
@anpete - Is this same as in-memory like we have? |
Oh, we have |
How can we use the patindex function now? Or could I get the index in which like or match pattern happens? |
@irg1008 take a look at the comment just above. |
Yeah but Like does not return the index and used inside where, I need to know the index to get a substring of a column value |
Thanks, I misread your comment. EF Core doesn't current have a translation for SQL Server PATINDEX, I opened #33702 to track that. In the meanwhile, if you need this, you should be able to use user-defined function mapping to map a .NET method stub of your own to PATINDEX. |
In the "old" Entity Framework it was possible to use
SqlFunctions
in order to create something like an ordinaryLIKE
statement.... where SqlFunctions.PatIndex("%na_f%", x.Name) > 0...
While in the "new" Entity Framework there seems to be no replacement for
SqlFunctions
. That approach was a workaround anyway, but some way to use a simpleLIKE
statement would be very useful. If not essential.The text was updated successfully, but these errors were encountered: