Created
March 5, 2015 08:42
-
-
Save GraemeBradbury/77883f59ea316ae968e4 to your computer and use it in GitHub Desktop.
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
using System; | |
namespace Blah { | |
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true)] | |
public sealed class ValidatedNotNullAttribute : Attribute | |
{ | |
} | |
public static class Guard | |
{ | |
public static void ArgumentNotNull([ValidatedNotNull] object argumentValue, string argumentName) | |
{ | |
if (argumentValue == null) | |
{ | |
throw new ArgumentNullException(argumentName); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment