title: Resolving a parameter name at runtime
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/72121/finding-the-variable-name-passed-to-a-function-in-c-sharp">Finding the Variable Name passed to a Function in C#</a>  </p>
  </blockquote>
  
  
  
  <p>In C#, is there a way (terser the better) to resolve the name of a parameter at runtime?</p>
  
  <p>For example, in the following method, if you renamed the method parameter, you'd also have to remember to update the string literal passed to ArgumentNullException.</p>
  
  <pre><code>    public void Woof(object resource)
      {
          if (resource == null)
          {
              throw new ArgumentNullException("resource");
          }
  
          // ..
      }
  </code></pre>