コード例 #1
0
    public ChildUnitOfWork([NotNull] IUnitOfWork parent)
    {
        Check.NotNull(parent, nameof(parent));

        _parent = parent;

        _parent.Failed   += (sender, args) => { Failed.InvokeSafely(sender, args); };
        _parent.Disposed += (sender, args) => { Disposed.InvokeSafely(sender, args); };
    }
コード例 #2
0
        public virtual void Dispose()
        {
            if (IsDisposed)
            {
                return;
            }
            IsDisposed = true;
            if (!IsCompleted || _exception != null)
            {
                Failed.InvokeSafely(this, new UnitOfWorkFailedEventArgs(this, _exception, _isRolledback));
            }

            OnDisposed();
        }
コード例 #3
0
ファイル: UnitOfWorkBase.cs プロジェクト: nozerowu/ABP
 /// <summary>
 /// Called to trigger <see cref="Failed"/> event.
 /// </summary>
 /// <param name="exception">Exception that cause failure</param>
 protected virtual void OnFailed(Exception exception)
 {
     Failed.InvokeSafely(this, new UnitOfWorkFailedEventArgs(exception));
 }
コード例 #4
0
 protected virtual void OnFailed()
 {
     Failed.InvokeSafely(this, new UnitOfWorkFailedEventArgs(this, _exception, _isRolledback));
 }