protected void InvokePreOperation(PreOperationDelegate <TEntity>? @delegate, TEntity entity)
        {
            var cancelArg = new CancelEventArgs();

            try
            {
                @delegate?.Invoke(entity, cancelArg);
            }
            catch { }
            if (cancelArg.Cancel)
            {
                throw new CanceledException("Cancelled by event");
            }
        }
예제 #2
0
        protected void InvokePreOperation <T>(PreOperationDelegate <T>? @delegate, T entity)
            where T : TPrimaryKeyEntity
        {
            var cancelArg = new CancelEventArgs();

            try
            {
                @delegate?.Invoke(entity, cancelArg);
            }
            catch { }
            if (cancelArg.Cancel)
            {
                throw new CanceledException("Cancelled by event");
            }
        }