Example #1
0
        /// <summary>
        /// Raises an ArgumentValidationException if validation has any issues.
        /// </summary>
        public void RaiseIfHasIssues()
        {
            if (IsEmpty)
            {
                return;
            }
            var ex = new ArgumentValidationException();

            ex.SetNotifications(_notifications);
            throw ex;
        }
Example #2
0
        /// <summary>
        /// Raises an ArgumentValidationException if validation fails.
        /// </summary>
        public void RaiseWhenFailed()
        {
            if (!HasError)
            {
                return;
            }
            var ex = new ArgumentValidationException();

            ex.SetNotifications(_notifications);
            throw ex;
        }