Created
August 12, 2013 12:15
-
-
Save pseudomuto/6210341 to your computer and use it in GitHub Desktop.
A simple class for guarding against nulls, etc..
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
internal static class Guard | |
{ | |
public static void AgainstNull(string name, object value) | |
{ | |
if (value == null) | |
{ | |
throw new ArgumentNullException(name); | |
} | |
} | |
public static void AgainstNullOrEmpty(string name, string value) | |
{ | |
if (string.IsNullOrEmpty(value)) | |
{ | |
throw new ArgumentNullException(name); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment