title: Is there a way to turn this small method into a lambda or linq statement?
body: <p>I have the following method:</p>
  
  <pre><code>private static object[] GenerateParameters(MethodBase executingMethod)
  {
      var parameterInfoList = MethodBase.GetCurrentMethod().GetParameters();
      var parameterObjectList = new List&lt;object&gt;();
  
      for (var i = 0; i &lt; parameterInfoList.Count(); i++)
      {
          parameterObjectList.Add(parameterInfoList.GetValue(i));
      }
  
      return parameterObjectList.ToArray();
  }
  </code></pre>
  
  <p>It just seems to me that is is bloated and over complicated. Is there a way to turn this method into one or two lines of code that will do the same thing? Possibly using Lambda or LINQ.</p>
  
  <p>The reason why I think it is so bloated is because you can only get the value of the parameters from a parameterInfo array and not each parameterInfo (parameterInfo has no GetValue). There has to be a better way to do this.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>There was A LOT of great answers, and each of them worked, so thank you to everyone.</p>