Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class Guard
- {
- public static void NotNull<T>(string argumentName, T value)
- where T : class
- {
- if (value == null)
- throw new ArgumentNullException(argumentName);
- }
- public static void NotEmpty(string argumentName, string value)
- {
- if (String.IsNullOrWhiteSpace(value))
- throw new ArgumentException("Non-empty string expected", argumentName);
- }
- }
Add Comment
Please, Sign In to add comment