如何將以下 Postgresql 查詢轉換為 Entity Framework Core Where 子句?
select title from some_table where title ~ '[^[:ascii:]]';
uj5u.com熱心網友回復:
~是使用正則運算式進行模式匹配的運算子。Npgsql EF Core 提供程式會自動翻譯 .NET Regex.IsMatch,因此您可以嘗試使用它:
context.SomeTable
.Where(t => Regex.IsMatch(t.Title, "[^[:ascii:]]"))
...
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/470023.html
標籤:C# PostgreSQL 实体框架核心
上一篇:在方法之間參考變數
