I have โtear off my hairโ - a problem with the Entity Framework, and I just can't find a solution.
What I want to do is compare the strings for the search function that I run on the server. This is basically: collection.Where(c => c.Name.Contains(searchTerm)); where searchTerm is the string passed by the user.
Everywhere I watch it:
However, none of them relates to my case. Here's a similar question that has no answer: Entity Framework - case insensitive Contains?
Using the first alternative will result in each row in the database, and then execute toUpper () to see if it matches. This is unacceptable in performance.
The second approach, most likely, is the right decision, but for some reason does not work. I have two databases. One local and one remote. The remote MSSQL database is configured to sort: Finnish_Swedish_CI_AS, which means it is case insensitive? The local database is an automatically generated localDB for which the Case Sensitive property is set to False.
Regardless of which of these two databases I use, it is still always case sensitive for users.
Can someone explain why this is happening so that I can continue my miserable life?
Regards, Robin Dorbell
c # sql-server linq asp.net-mvc entity-framework
Robin dorbell
source share