小编psl*_*sla的帖子

实体框架中的异步提交?

如何在实体框架中异步提交事务?

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

entity-framework transactions

6
推荐指数
1
解决办法
2006
查看次数

标签 统计

entity-framework ×1

transactions ×1