Exemplo n.º 1
0
        public static Validation Append(this Validation destination, Validation target)
        {
            switch (destination)
            {
            case null when target == null:
                return(null);

            case null:
                return(target);
            }

            if (target == null)
            {
                return(destination);
            }

            target.Exceptions.ForEach(e => destination.Add(e));
            return(destination);
        }
Exemplo n.º 2
0
 public static Validation Or(this Validation validation, string message, params bool[] criteria)
 {
     return(criteria.Any() ? validation.Add(new ValidationException(message)) : validation);
 }