title: Action<T> Get parameter value
body: <p>Goal: Pass an Action&lt; T > to a method to be ran. The idea is if the method uses T then we can specify the type we will be passing into the method as a parameter rather than having to use dynamics.</p>
  
  <p>Issue: I'm unable to get the parameter value, what is the best way to do this (most likely using reflection)?</p>
  
  <p>Code:</p>
  
  <pre><code>public static void RunVoidMethod&lt;T&gt;(Action&lt;T&gt; methodToRun)
  {            
      try
      {
          // Below is a ParameterInfo, I want the parameter value for methodToRun
          var parameterValue = methodToRun.Method.GetParameters()[0];    
          methodToRun(parameterValue);
      }
      catch (Exception e)
      {
          throw;
      }    
  }
  </code></pre>
  
  <p>The worst case scenario is I can add an optional parameter which can also be of type T but I'm hoping to avoid this if possible.</p>