title: Type.GetMethod with a Generic overload - Get Generic MethodInfo without looping through all Methods
body: <p>I Have two functions:</p>
  
  <ol>
  <li><code>public void DeleteRecord(int id);</code></li>
  <li><code>public T DeleteRecord&lt;T&gt;(int id);</code></li>
  </ol>
  
  <p>Here's how i try to dynamically invoke the generic method:</p>
  
  <pre><code>MethodInfo method = typeof(DAL).GetMethod("DeleteRecord", new[] { typeof(int) });
  MethodInfo generic = method.MakeGenericMethod(returnType);
  object o = generic.Invoke(null, new object[] { dbname, spname, expandoAsDictionary });
  </code></pre>
  
  <p>The first line throws an exception because it finds an ambiguous definition. Is there a way i can get the <code>MethodInfo</code> of the generic method without using <code>GetMethods</code> and looping through the results asking for <code>IsGenericMethod</code>?</p>
  
  <p>Edit:
  Please remove the 'Duplicate' because both of the suggested answers either solve this with an inner loop (GetMethods().Select...) or don't even address overloads.</p>