如何在实体框架中异步提交事务?
using (var transaction = this.db.Database.BeginTransaction())
{
this.db.DoSomething();
await this.db.SaveChangesAsync().ConfigureAwait(false);
// note .Commit isn't async but it involves network i/o
transaction.Commit();
}
Run Code Online (Sandbox Code Playgroud)
我想让 .Commit 异步,但我在DbContextTransaction 中没有看到合适的 API