title: Method.Invoke failing with Parameter Count Mismatch
body: <p>I am trying to invoke a generic method.  The definition of the method is as follows:</p>
  
  <pre><code>public System.Collections.Generic.IList&lt;T&gt; Query&lt;T&gt;(string query, [string altUrl = ""])
  where T : new()
  </code></pre>
  
  <p>This is from the SalesforceSharp library on github.  I am trying to make an additional service layer over this call and am struggling to invoke it.  See my code below.</p>
  
  <pre><code>public List&lt;T&gt; Query&lt;T&gt;()
      {
          //IList&lt;Salesforce.Account&gt; _returnList = null;
          IList&lt;T&gt; _returnList = null;
          Type _t = typeof(T);
  
          SqlBuilder _sb = new SqlBuilder();
          _sb.Table = _t.Name.ToString();
          foreach (PropertyInfo p in _t.GetProperties()) _sb.Fields.Add(p.Name.ToString());
  
          MethodInfo method = _Client.GetType().GetMethod("Query");
          method = method.MakeGenericMethod(_t);
          try
          {
              object[] _prms = new object[1];
              _prms[0] = _sb.SQL;
              _returnList = (IList&lt;T&gt;)method.Invoke(_Client, new object[] { _prms });
              //_returnList = _Client.Query&lt;Salesforce.Account&gt;(_sb.SQL);
          }
          catch { }
          return (List&lt;T&gt;)_returnList;
      }
  </code></pre>
  
  <p>If I run this i get a Parameter Count Mismatch exception on the method.invoke line, but i am confused because if i bring in the two uncommented lines and execute without the generic call it is working ok.  I have tried many combinations of string arrays wrapped in object arrays, strings in strings, etc but can't get it to go.  I thought maybe it was treating the second parameter as mandatory?  but adding another object to my _prms array didnt work either.</p>
  
  <p>Please help!</p>
  
  <p>Thanks,
  Dom</p>