Created
December 28, 2012 17:04
-
-
Save emiaj/4399792 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 ShortCircuitFieldRule : IFieldValidationRule | |
| { | |
| private readonly IFieldValidationRule _inner; | |
| public ShortCircuitFieldRule(IFieldValidationRule inner) | |
| { | |
| _inner = inner; | |
| } | |
| public void Validate(Accessor accessor, ValidationContext context) | |
| { | |
| if(!context.Notification.MessagesFor(accessor).Any()) | |
| { | |
| _inner.Validate(accessor, context); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment