title: Generic method where T is type1 or type2
body: <p>Is there a way to declare a generic function that the generic type is of type1 <strong>or</strong> type2?</p>
  
  <p>example:</p>
  
  <pre><code>public void Foo&lt;T&gt;(T number)
  {
  }
  </code></pre>
  
  <p>Can I constraint T to be int or long  </p>