How can I translate the following Postgresql query to the Entity Framework Core Where clause?
select title from some_table where title ~ '[^[:ascii:]]';
CodePudding user response:
~
is an operator for pattern matching using regular expressions. Npgsql EF Core provider automatically translates .NET's Regex.IsMatch
so you can just try using it:
context.SomeTable
.Where(t => Regex.IsMatch(t.Title, "[^[:ascii:]]"))
...