title: Create Dynamic <T> in C#
body: <p>I need to create Dynamic T using interface. But I am getting "Type Casting" error. 
  Here is my code :</p>
  
  <pre><code>interface IEditor { }
  
  class Editor : IEditor { }
  
  class Test&lt;T&gt; { }
  </code></pre>
  
  <p>Now the  will be dynamic so I am using this code below :</p>
  
  <pre><code>Test&lt;IEditor&gt; lstTest = (Test&lt;IEditor&gt;)Activator.CreateInstance(typeof(Test&lt;&gt;).MakeGenericType(typeof(Editor)));
  </code></pre>
  
  <p>I am getting following error</p>
  
  <blockquote>
    <p>Unable to cast object of type 'CSharp_T.Test`1[CSharp_T.Editor]' to type 'CSharp_T.Test`1[CSharp_T.IEditor]'.</p>
  </blockquote>
  
  <p>This error is not compilation error but I am getting run time error.</p>