Last active
October 15, 2018 03:58
-
-
Save luismts/9596e7a7c64f55d65611c5bf4e37991c 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
using Plugin.ValidationRules.Interfaces; | |
namespace ValidationRulesTest.Validations | |
{ | |
public class IsNotNullOrEmptyRule<T> : IValidationRule<T> | |
{ | |
public string ValidationMessage { get; set; } | |
public bool Check(T value) | |
{ | |
if (value == null) | |
{ | |
return false; | |
} | |
var str = value as string; | |
return !string.IsNullOrWhiteSpace(str); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment