1

How can I translate the following Postgresql query to the Entity Framework Core Where clause?

select title from some_table where title ~ '[^[:ascii:]]';

1 Answer 1

2

~ 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:]]"))
    ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.