Created
December 23, 2016 12:37
-
-
Save pedroreys/42697e0812f5df6f4ca3831262f73f60 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 PurchaseItemValidator : IValidator<PurchaseItem> | |
{ | |
private IEnumerable<IValidationRule<PurchaseItem>> _rules; | |
public PurchaseItemValidator(IEnumerable<IValidationRule<PurchaseItem>> rules) | |
{ | |
_rules = rules; | |
} | |
public IEnumerable<ValidationResult> Validate(PurchaseItem command) | |
{ | |
return _rules.Select(r => r.Validate(command)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment