title: Can C# return a type in a method?
body: <p>can i have something like:</p>
  
  <pre><code>AMess.Foo = MessyData.GetData&lt;MessyData.GetType(key)&gt;(key);
  </code></pre>
  
  <p>?</p>
  
  <p>my problem is similar to my example. I have a data source is dynamically typed, so i have to do something to determine the data type. but it's a pain in the ass to put type check everywhere. so i think maybe i could have some code just to tell me what type it is. can i do this?</p>
  
  <p>or maybe better solution?</p>
  
  <p>please not worry about <code>AMess.Foo</code>, it eats everything.</p>