title: What is the equivalent of a template class in C# that inherits from the specified type?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1842636/why-cannot-c-sharp-generics-derive-from-one-of-the-generic-type-parameters-like">Why cannot C# generics derive from one of the generic type parameters like they can in C++ templates?</a><br>
    <a href="https://stackoverflow.com/questions/5895363/generic-class-that-inherits-its-generic-type">Generic class that inherits its generic type</a>  </p>
  </blockquote>
  
  
  
  <p>I would like to be able to do something like this, only in C#:</p>
  
  <pre><code>template&lt;class MyClass&gt;
  class MockComposite : MyClass
  {
  
  };
  </code></pre>
  
  <p>The class above inherits from the specified type. MyClass is a base type, and this is the reason I want this behaviour. I want to be able to instantiate this object with classes derived from MyClass.</p>
  
  <p>I understand you cannot use templates in C#, but is there any way to get the behaviour I want without having to write a new class for each different type of object?</p>
  
  <p>EDIT - I want to be able to instantiate an object that will test the behaviour of any class, as long as that class is derived from a specified type - 'MyClass'.</p>