Created
August 30, 2012 00:07
-
-
Save emiaj/3520765 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 SomeRule : IValidationRule | |
| { | |
| private readonly ISomeService _service; | |
| public SomeRule(ISomeService service) | |
| { | |
| _service = service; | |
| } | |
| public void Validate(ValidationContext context) | |
| { | |
| if (!_service.IsValid()) | |
| { | |
| context.Notification.RegisterMessage(StringToken.FromKeyString("SomeRule")); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment