title: Invoke a non generic method with generic arguments defined in a generic class
body: <p>Here is my issue;</p>
  
  <pre><code>public class MyClass&lt;T&gt;
  {
     public void DoSomething(T obj)
     {
        ....
     }
  }
  </code></pre>
  
  <p>What I did is:</p>
  
  <pre><code>var classType = typeof(MyClass&lt;&gt;);
  Type[] classTypeArgs = { typeof(T) };
  var genericClass = classType.MakeGenericType(classTypeArgs);
  var classInstance = Activator.CreateInstance(genericClass);
  var method = classType.GetMethod("DoSomething", new[]{typeof(T)});
  method.Invoke(classInstance, new[]{"Hello"});
  </code></pre>
  
  <p>In the above case the exception I get is: Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.</p>
  
  <p>If I try to make the method generic it fails again with an exception:
  MakeGenericMethod may only be called on a method for which MethodBase.IsGenericMethodDefinition is true.</p>
  
  <p>How should I invoke the method?</p>