Skip to content

Instantly share code, notes, and snippets.

@GraemeBradbury
Created March 5, 2015 08:42
Show Gist options
  • Save GraemeBradbury/77883f59ea316ae968e4 to your computer and use it in GitHub Desktop.
Save GraemeBradbury/77883f59ea316ae968e4 to your computer and use it in GitHub Desktop.
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