title: C# generics syntax for multiple type parameter constraints
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/588643/generic-methods-and-multiple-constraints">Generic methods and multiple constraints</a>  </p>
  </blockquote>
  
  
  
  <p>I need a generic function that has two type constraints, each inheriting from a different base class. I know how to do this with one type:</p>
  
  <pre><code>void foo&lt;T&gt;() where T : BaseClass
  </code></pre>
  
  <p>However, I don't know how to do this with two types:</p>
  
  <pre><code>void foo&lt;TOne, TTwo&gt;() where TOne : BaseOne // and TTwo : BaseTwo ???
  </code></pre>
  
  <p>How do you do this? (using .NET 2)</p>