public ValidationErrors Build() { if (this.r == null) { return(null); } return(ValidationErrors.Join(this.r)); }
// TODO: cut down allocations public static ValidationErrors ValidateList<T>(this IEnumerable<T> array, Func<T, ValidationErrors> validator) => ValidationErrors.Join(array.Select((v, i) => validator(v).Nest(i.ToString())).ToArray());