title: C# generic types
body: <p>I use in my library three classes:</p>
  
  <pre><code>public abstract class Base&lt;TFirst, TSecond&gt;
  {
      public Base()
      {
        // actions with ID and Data of TFirst and TSecond
      }
  }
  
  public abstract class First&lt;TFirstID, TFirstData&gt;
  {
      public TFirstID ID {get; set;}
      public TFirstData Data {get; set;}
  }
  
  public abstract class Second&lt;TSecondID, TSecondData&gt;
  {
      public TSecondID ID {get; set;}
      public TSecondData Data {get; set;}
  }
  </code></pre>
  
  <p>How can I specify that TFirst must inherit from the First and TSecond must inherit from the Second, not using generic types for ID and Data in Base?</p>
  
  <p>Like this:</p>
  
  <pre><code>public abstract class Base&lt;TFirst, TSecond&gt;
      where TFirst : First // without generic-types
  ...
  </code></pre>
  
  <p><strong>Edit:</strong>
  In classes First, Second I use TFirstID and TSecondID for properties. In class Base I use this properties.</p>