Guest User

Untitled

a guest
Feb 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. public static class Guard
  2. {
  3. public static void NotNull<T>(string argumentName, T value)
  4. where T : class
  5. {
  6. if (value == null)
  7. throw new ArgumentNullException(argumentName);
  8. }
  9.  
  10. public static void NotEmpty(string argumentName, string value)
  11. {
  12. if (String.IsNullOrWhiteSpace(value))
  13. throw new ArgumentException("Non-empty string expected", argumentName);
  14. }
  15. }
Add Comment
Please, Sign In to add comment