I have this
public static class Parameters
{
public static void Required<T>(this T parameter, string paramName) where T : class
{
if (parameter == null)
{
throw new ArgumentNullException(paramName);
}
// ...
}
}
And I use it like:
Parameters.Required(settings, nameof(settings));
Is it possible to get rid of the second parameter and somehow get the original parameter name, from within the Required
method? No, right?