title: Keep a Dictionary<Type, MyClass<T>> where elements are referenceable by type
body: <p>I have an abstract class called EntityTypeTransform with a single abstract method designed to hold a Func delegate that converts an IDataRecord into an instance of T.</p>
  
  <pre><code>public abstract class EntityTypeTransform&lt;TEntityType&gt; where TEntityType : class
  {
      public abstract Func&lt;IDataRecord, TEntityType&gt; GetDataTransform();
  }
  </code></pre>
  
  <p>An implementation of that class might look like (does look like) this:</p>
  
  <pre><code>public class TaskParameterEntityTypeTransform : EntityTypeTransform&lt;TaskParameter&gt;
  {
      public override Func&lt;IDataRecord, TaskParameter&gt; GetDataTransform()
      {
          return dataRecord =&gt; new TaskParameter()
          {
              TaskId = (int)dataRecord["task_id"],
              Name = (string)dataRecord["p_name"],
              Value = (string)dataRecord["p_value"]
          };
      }
  }
  </code></pre>
  
  <p>Now I want to keep an instance of each of these classes in a generic Dictionary, something like:</p>
  
  <pre><code>Dictionary&lt;Type, EntityTypeTransform&lt;T&gt;&gt;
  </code></pre>
  
  <p>But this doesn't work because (for example) an instance of EntityTypeTransform Of Task is not the same as an instance of EntityTypeTransform Of TaskParameter.</p>
  
  <p>Can anyone help me out?</p>
  
  <p>Edit: I should add that the Type key = typeof(T)</p>