public Task SaveEventAsync(IntegrationEvent @event, IDbContextTransaction transaction) { if (transaction == null) { throw new ArgumentNullException(nameof(transaction)); } var eventLogEntry = new IntegrationEventLogEntry(@event, transaction.TransactionId); _integrationEventLogContext.Database.UseTransaction(transaction.GetDbTransaction()); _integrationEventLogContext.IntegrationEventLogs.Add(eventLogEntry); return(_integrationEventLogContext.SaveChangesAsync()); }
public async Task SaveEventAsync(Event @event, IDbContextTransaction transaction) { if (transaction == null) { throw new ArgumentNullException(nameof(transaction)); } var eventLogEntry = new EventLogEntry(@event, transaction.TransactionId); _eventLogContext.Database.UseTransaction(transaction.GetDbTransaction()); _eventLogContext.EventLogs.Add(eventLogEntry); await _eventLogContext.SaveChangesAsync(); _eventLogContext.Database.UseTransaction(null); }