title: Cast to a reflected Type in C#
body: <p>Consider the following code: </p>
  
  <pre><code>object objFoo = MakeFoo(); // object MakeFoo(){return new Foo();}
  MethodInfo methodInfo = typeof(Program).GetMethod("Baz"); // Foo Baz(){return foo;}
  Type typeFoo = methodInfo.ReturnType;
  var result = (typeFoo)objFoo;
  </code></pre>
  
  <p>Do I need to do some magic with <code>typeFoo</code> to get the result?</p>