public void Dispose() { if (IsDisposed) { return; } IsDisposed = true; var disposeExceptions = new List <Exception>(); foreach (var transactionFeature in _transactionFeatures.Values) { try { transactionFeature.Dispose(); } catch (Exception ex) { disposeExceptions.Add(ex); } } if (disposeExceptions.Count > 0) { throw new AggregateException(disposeExceptions); } DisposeHandler.Invoke(this, this); }
public void Dispose() { if (IsDisposed) { throw new InvalidOperationException("this unit of work is already dispose"); } IsDisposed = true; DisposeHandler?.Invoke(this, this); _parentUow = null; }