Closed kensmaster closed 2 years ago
//批量更新错误写法 await DBContext.UpdateAsync(entitys);
//批量更新正常写法 entitys.ForEach(async e => { await DBContext.UpdateAsync(e); });
public static int UpdateBatch(this DbContext dbContext, List entities)
自行添加个扩展方法就好了
ps:内部记得使用事务~
//批量更新错误写法 await DBContext.UpdateAsync(entitys);
//批量更新正常写法 entitys.ForEach(async e => { await DBContext.UpdateAsync(e); });