title: What is the best way to check the parameters of the method?
body: <p>I know two ways to check parameters of the method and throw exceptions when it is needed.</p>
  
  <p>1) Check one each parameter and throw an exception when it is wrong:</p>
  
  <pre><code>public void Method(object parameter1, object parameter2)
  {
      if (parameter1 == null)
      {
          throw new ArgumentNullException("parameter1");
      }
  
      if (parameter2 == null)
      {
          throw new ArgumentNullException("parameter2");
      }
  
      ...
  }
  </code></pre>
  
  <p>2) Check all parameters at once and throw same exception for all:</p>
  
  <pre><code>public void Method(object parameter1, object parameter2)
  {
      if (parameter1 == null || parameter2 == null)
      {
          throw new ArgumentNullException();
      }
  
      ...
  }
  </code></pre>
  
  <p>The first approach is, in my opinion, better and cleaner, but also cover a lot of lines. For example, a method that actually do the 2 lines of code - in this way code will increase by 4 rows (including blank line) for each parameter.</p>
  
  <p>I am interested in is the approach used by experienced programmers. Are there better ways than these two?</p>