title: How to call a generic async method using reflection
body: <pre><code>public interface IBar {
  }
  public class Bar : IBar {
  }
  public class Bar2 : IBar {
  }
  public interface IFoo {
    Task&lt;T&gt; Get&lt;T&gt;(T o) where T : IBar;
  }
  public class Foo : IFoo {
    public async Task&lt;T&gt; Get&lt;T&gt;(T o) where T : IBar {
      ...
    }
  }
  </code></pre>
  
  <p>I can then call this method using reflection:</p>
  
  <pre><code>var method = typeof(IFoo).GetMethod(nameof(IFoo.Get));
  var generic = method.MakeGenericMethod(bar2.GetType());
  var task = generic.Invoke(foo, new [] { bar2 });
  </code></pre>
  
  <p>How do I await on this <code>Task</code>? and How do I cast it to <code>Task&lt;bar2.GetType()&gt;</code>?</p>