Created
April 5, 2019 11:00
-
-
Save btodts/f13b6722e8f4569bb179f63d91a30d6c to your computer and use it in GitHub Desktop.
This file contains 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
public static class Guard | |
{ | |
public static void GuidNotEmpty(Guid argument, string argumentName) | |
{ | |
if (argument == Guid.Empty) | |
throw new GuardException(argumentName, "Guid should not be empty."); | |
} | |
public static void StringNotNullOrEmpty(string argument, string argumentName) | |
{ | |
if (string.IsNullOrEmpty(argument)) | |
throw new GuardException(argumentName, "String should not be null or empty."); | |
} | |
// other guards | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment