最近我开始在我们的项目中使用EF+,并取得了巨大的成功,但有时我会遇到一个问题,即我有一组实体需要运行单独的查询。
因此,如果我有一组 20 个客户,我需要分别运行 20 个查询。我想知道是否有办法在 foreach 循环中以某种方式使用 EF+ FutureValue() 来避免这种情况。
请参阅此示例代码:
foreach (var customer in customers)
{
customer.SomeValue = ctx.SomeDatabaseTable.Where(myCondition).FutureValue();
// this would run 20 times ... any way how to run all of the 20 queries at once?
}