title: How to get MethodInfo for open generic type from MethodInfo of closed type
body: <p>Assume I have a class like so:</p>
  
  <pre><code>public class MyClass&lt;T&gt;
  {
      public void Foo(T t)
      {
      }
  }
  </code></pre>
  
  <p>Now, assume, I have an instance of <code>MyClass&lt;int&gt;</code> and a <code>MethodInfo</code> of its <code>Foo</code> method.
  Calling <code>methodInfo.GetParameters()</code> will return a <code>ParameterInfo</code> array with one entry, referring to type <code>int</code>. My problem is, that I can't seem to find out, if that parameter was declared as <code>int</code> in the class or as <code>T</code>.  </p>
  
  <p><strong>What am I trying to achieve?</strong><br>
  At runtime, I want to read the documentation of the method specified by <code>MethodInfo</code> from the XML Doc file generated by Visual Studio.<br>
  For the above defined method, the key looks like this: </p>
  
  <pre><code>&lt;namespace&gt;.MyClass`1.Foo(`0)
  </code></pre>
  
  <p>The <code>`0</code> refers to the first generic type parameter of the declaring class. To be able to construct this string, I need to somehow get this information.<br>
  <em>But how?</em> <code>MethodInfo</code> doesn't seem to contain that info...</p>