title: Is it possible to have non-generic method return generic type?
body: <p>In Java I can easily write:</p>
  
  <pre><code>public interface MyInterface&lt;T extends Object&gt;
  </code></pre>
  
  <p>and then have a method which determine the T at runtime like:</p>
  
  <pre><code>public MyInterface&lt;?&gt; DetermineObjectAtRuntime()
  </code></pre>
  
  <p>But in C# where <code>&lt;?&gt;</code> is not available and I need to call the method with type; which means I need to know the type before hand.</p>
  
  <ol>
  <li>Is it possible to return generics type from non-generic method?</li>
  <li>If not, how can I work out the type to call such generic method if I have an object instance with that type?</li>
  </ol>
  
  <p>For people who are not sure what this is for - I have a set of data structures which are using different enums as field indexers. All the messages extends from a common generic interface with that enum as type variable. Now I need to work out a method which deserialize all different types of messages from a byte[] array.</p>