public static ApiValidationResult Aggregate(params ApiValidationResult[] results) { if (results == null) { return(Ok()); } var result = new ApiValidationResult(); results.SafeForEach(r => result.Append(r)); return(result); }
public static ApiValidationResult Aggregate(params ApiValidationError[] errors) { if (errors == null) { return(Ok()); } var result = new ApiValidationResult(); errors.ForEach(e => result.Append(e)); return(result); }
public ApiValidationResult Append(ApiValidationResult other) { if (other == null) { return(this); } Success &= other.Success; if (other.Errors != null) { EnsureErrorsPropertyIsNotNull(); Errors.AddRange(other.Errors.Where(e => e != null)); } return(this); }