예제 #1
0
        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);
        }
예제 #2
0
        public void Dispose()
        {
            if (IsDisposed)
            {
                throw new InvalidOperationException("this unit of work is already dispose");
            }

            IsDisposed = true;

            DisposeHandler?.Invoke(this, this);

            _parentUow = null;
        }