Created
January 13, 2016 19:47
-
-
Save Finglas/ee7de5821376ce26543b to your computer and use it in GitHub Desktop.
Validation Service Results
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ValidationResults | |
{ | |
public ValidationResults(List<Error> errors) | |
{ | |
this.Errors = errors; | |
} | |
public List<Error> Errors { get; private set; } | |
public static ValidationResults Empty() | |
{ | |
return new ValidationResults(new List<Error>()); | |
} | |
public bool IsValid() | |
{ | |
return !this.Errors.Any(); | |
} | |
public void Append(ValidationResults validationResults) | |
{ | |
this.Errors.AddRange(validationResults.Errors); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment