Beispiel #1
0
        /// <summary>
        /// Adds the specified violation.
        /// </summary>
        /// <param name="violation">The violation.</param>
        public void Add(RuleViolation violation)
        {
            if (!_violations.ContainsKey(violation.Key))
            {
                _violations.Add(violation.Key, new List<RuleViolation>());
            }

            _violations[violation.Key].Add(violation);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ValidationException"/> class.
        /// </summary>
        /// <param name="violation">The violation.</param>
        public ValidationException(RuleViolation violation)
        {
            if (violation == null) throw new ArgumentNullException("violations");

            this.RuleViolations = new RuleViolation[] { violation };
        }