title: Inherits from Anonymous Type T
body: <p>Is it possible to inherits from an anonymous Type for example, I have some classes and interfaces like </p>
  
  <pre><code>public interface IFoo{
       int A { get; set;}
       string B { get; set;}
  }
  
  public interface IBoo : IFoo{
       decimal C { get; set;}
  }
  
  public class Foo: IFoo {...}
  
  public class Boo: IBoo {...}
  </code></pre>
  
  <p>now I want to define a class that extends the existing classes by adding some new properties which is applied to all class in the same way :</p>
  
  <pre><code>public class Extended&lt;T&gt; : T where T: IFoo
  {
      bool D { get; set;}
  }
  </code></pre>
  
  <p>so as a result in case of <code>Extended&lt;Foo&gt;</code>, the properties inside the <code>Extended&lt;Foo&gt;</code> would be: </p>
  
  <pre><code> public int A { get; set;}
   public string B { get; set;}
   public bool D { get; set;}
  </code></pre>
  
  <p>I know this will give compilation error:</p>
  
  <blockquote>
    <p>CS0689: Cannot derive form 'T' because it is a type parameter</p>
  </blockquote>
  
  <p>but why this is not applicable? as long as I am putting constraints in the declaration</p>
  
  <p>The current solution: I should create a class <code>ExtendedFoo</code> which implements <code>IFoo</code> and <code>ExtendedBoo</code> which implements <code>IBoo</code> , my concern is if there is a way or workaround to be able to define one generic class that inherits all these type of classes where they implement the interface Foo.</p>
  
  <p>Hope my question is clear</p>