We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f60ff9b commit 54d2190Copy full SHA for 54d2190
src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs
@@ -66,9 +66,10 @@ public async Task CommitAsync(CancellationToken cancellationToken = default)
66
public async Task RollbackAsync(CancellationToken cancellationToken = default)
67
{
68
if (!UseTransaction || !TransactionHasBegun)
69
- throw new NotSupportedException("Transactions are not opened and rollback is not supported");
+ return;
70
71
- await Context.Database.RollbackTransactionAsync(cancellationToken);
+ if (TransactionHasBegun)
72
+ await Context.Database.RollbackTransactionAsync(cancellationToken);
73
}
74
75
public Task AddDomainEventAsync<TDomainEvent>(TDomainEvent @event) where TDomainEvent : class
0 commit comments