You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support string.Contains(String, StringComparison) overload #1498
See dotnet/efcore#1222 for a full discussion on this. The summary is that string operations which accept StringComparison are not translated in EF Core, for various reasons - it's very easy to cause indexes not to get used (very bad for perf), and in many cases a specific collation needs to be specified by the user - just saying "insensitive" isn't specific enough (for PG ILike this doesn't necessary hold, but still).
Take a look at the docs around case sensitivity and collations. If you're OK with trying out the latest 5.0.0 preview (very stable, 5.0.0 is about to be released), consider defining a case-insensitive collation on your Name column - this would help with index usage (though probably not with most Contains operations). Otherwise just using ILike or citext could work.
Note that in the code above, if currentFilter happens to contain one of the wildcards (%, _) you'll probably get incorrect results.
Activity
roji commentedon Sep 12, 2020
See dotnet/efcore#1222 for a full discussion on this. The summary is that string operations which accept StringComparison are not translated in EF Core, for various reasons - it's very easy to cause indexes not to get used (very bad for perf), and in many cases a specific collation needs to be specified by the user - just saying "insensitive" isn't specific enough (for PG ILike this doesn't necessary hold, but still).
Take a look at the docs around case sensitivity and collations. If you're OK with trying out the latest 5.0.0 preview (very stable, 5.0.0 is about to be released), consider defining a case-insensitive collation on your Name column - this would help with index usage (though probably not with most Contains operations). Otherwise just using ILike or citext could work.
Note that in the code above, if
currentFilterhappens to contain one of the wildcards (%, _) you'll probably get incorrect results.roji commentedon Sep 12, 2020
Duplicate of dotnet/efcore#1222