dotnet / efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
https://docs.microsoft.com/ef/
MIT License
13.63k stars 3.15k forks source link

Query: Add support for contains with StringComparison like ".Contains(searchString, StringComparison.InvariantCultureIgnoreCase)" #18881

Open habex-ch opened 4 years ago

habex-ch commented 4 years ago

I want to compare if a specific substring is in a string. The comparison should be case insensitive.

Until EFCore 2.2 i used e => e.Name.Contains(searchString, StringComparison.InvariantCultureIgnoreCase)

I can not use EF.Functions.Like because the query is created in a different project (presentation-layer) then EFCore.

It would be great if the StringComparision are translated into SQL code.

ajcvickers commented 4 years ago

@habex-ch This is related to #1222 but is considerably more difficult to implement because of the different translations used. Moving to the backlog.