如何在 EF core 3.0 中启用客户端评估?
How to enable client side evaluation In EF core 3.0?
我知道启用客户端评估是错误的,但我还是想启用它。
我想知道如何在 ef core 3.0 中做到这一点?
使用 AsEnumerable 在您的查询中明确切换到客户端评估。
var specialCustomers =
context.Customers
.Where(c => c.Name.StartsWith(n))
.AsEnumerable() // switch to LINQ to Objects to client-eval the rest of the query
.Where(c => IsSpecialCustomer(c));
我知道启用客户端评估是错误的,但我还是想启用它。 我想知道如何在 ef core 3.0 中做到这一点?
使用 AsEnumerable 在您的查询中明确切换到客户端评估。
var specialCustomers =
context.Customers
.Where(c => c.Name.StartsWith(n))
.AsEnumerable() // switch to LINQ to Objects to client-eval the rest of the query
.Where(c => IsSpecialCustomer(c));