Created
June 13, 2011 16:27
-
-
Save mikeobrien/1023113 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
public static T ThrowIfNull<T>(this T target) where T : class | |
{ | |
if (target == null) throw new NullReferenceException( | |
string.Format("Object reference of type '{0}' not set to an instance of an object.", typeof(T).FullName)); | |
return target; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment