title: Template function in C# - Return Type?
body: <p>It seems that c# does not support c++ like templates. For example</p>
  
  <pre><code>template &lt;class myType&gt;
  myType GetMax (myType a, myType b) {
   return (a&gt;b?a:b);
  }
  </code></pre>
  
  <p>I want my function to have return type based on its parameters, how can i achieve this in c#? How to use templates in C#</p>
  
  <p><strong>EDIT:</strong> Can i use object and getType for the almost same purpose?</p>