Skip to content

Commit

Permalink
StartTransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec committed Oct 1, 2024
1 parent d35f61f commit d2108d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Backend/Contexts/MongoDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public MongoDbContext(IOptions<Startup.Settings> options)

public async Task<IMongoTransaction> BeginTransaction()
{
return new MongoTransactionWrapper(await Db.Client.StartSessionAsync());
var session = await Db.Client.StartSessionAsync();
session.StartTransaction();
return new MongoTransactionWrapper(session);
}

private class MongoTransactionWrapper : IMongoTransaction
Expand Down

0 comments on commit d2108d5

Please sign in to comment.