I have the following extension method:
public static void ThrowIfArgumentIsNull(this T value, string argument)
where T : class
{
if (value
I would recommend that you rather do the following:
public static void ThrowIfArgumentIsNull(this object value, string argument)
{
if (value == null)
{
throw new ArgumentNullException(argument);
}
}
Using generics in this case doesn't seem to add any value. But as to your original question, I don't think that's possible.