Skip to content

Instantly share code, notes, and snippets.

@luismts
Last active October 15, 2018 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luismts/9596e7a7c64f55d65611c5bf4e37991c to your computer and use it in GitHub Desktop.
Save luismts/9596e7a7c64f55d65611c5bf4e37991c to your computer and use it in GitHub Desktop.
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