我在一个WCF服务上有以下方法:
/// <summary>
/// Receives the result of a request processing
/// </summary>
/// <param name="results">The resulting statuses for the processed account requests</param>
/// <returns>Whether the response was successfully handled</returns>
public bool SendRequestProcessingResult(IEnumerable<RequestProcessingResult> results)
{
foreach (var result in results)
{
// update entity
}
}
有没有一种方法可以同时更新所有实体?我应该只是添加每个更新然后SaveChanges
吗?在EF 4.1中进行这种“批量”更新的最佳方法是什么?