public ErrorMessageList Merge(ErrorMessageList errors) { var result = this; foreach (var error in errors.All <ErrorMessage>()) { result = result.With(error); } return(result); }
private IEnumerable <T> All <T>() where T : ErrorMessage { if (this != Empty) { if (head is T) { yield return((T)head); } foreach (T message in tail.All <T>()) { yield return(message); } } }