Exemplo n.º 1
0
        public override int SaveChanges()
        {
            using var transaction = TransactionExt.Begin(IsolationLevel.ReadCommitted);
            var changeLogs = GetChangeLogs();
            var result     = base.SaveChanges();

            _outbox.Send(changeLogs);
            transaction.Complete();
            return(result);
        }
Exemplo n.º 2
0
        public override async Task <int> SaveChangesAsync(CancellationToken cancellation)
        {
            using var transaction = TransactionExt.BeginAsync(IsolationLevel.ReadCommitted);
            var changeLogs = GetChangeLogs();
            var result     = await base.SaveChangesAsync(cancellation);

            await _outbox.SendAsync(changeLogs, cancellation);

            transaction.Complete();
            return(result);
        }