Is it possible to refactor this extension method?

后端 未结 6 804
小鲜肉
小鲜肉 2020-12-24 07:40

I have the following extension method:

public static void ThrowIfArgumentIsNull(this T value, string argument) 
    where T : class
{
    if (value          


        
6条回答
  •  梦谈多话
    2020-12-24 08:33

    In a word: no.

    The extension method is passed a value. It has no idea where the value comes from or what identifier the caller may have choosen to refer to it as.

提交回复
热议问题