shuxinqin / Chloe

A lightweight and high-performance Object/Relational Mapping(ORM) library for .NET --C#
https://github.com/shuxinqin/Chloe/wiki
MIT License
1.52k stars 457 forks source link

能封装下UpdateAsync吗,既然支持传List<T>那么就支持下更新操作嘛 #322

Closed kensmaster closed 2 years ago

kensmaster commented 2 years ago

//批量更新错误写法 await DBContext.UpdateAsync(entitys);

//批量更新正常写法 entitys.ForEach(async e => { await DBContext.UpdateAsync(e); });

shuxinqin commented 2 years ago

public static int UpdateBatch(this DbContext dbContext, List entities)

自行添加个扩展方法就好了

shuxinqin commented 2 years ago

ps:内部记得使用事务~