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); }
public static Validation Or(this Validation validation, string message, params bool[] criteria) { return(criteria.Any() ? validation.Add(new ValidationException(message)) : validation); }