Пример #1
0
        /// <summary>
        /// Merge two <see cref="RuleValidation"/> into one.
        /// </summary>
        /// <param name="source">The source object</param>
        public void Merge(RuleValidation source)
        {
            if (!source?.HasErrors() ?? false)
            {
                return;
            }

            if (!string.IsNullOrWhiteSpace(source.Message))
            {
                Message = source.Message;
            }

            Errors.AddRange(source.Errors);
        }
Пример #2
0
 public RuleException(RuleValidation rule) : this(rule.Message, rule)
 {
 }
Пример #3
0
 public RuleException(string message, RuleValidation rule) : this(message, rule, null)
 {
 }