title: Initialization all properties in a Generic Type?
body: <p>I want to initialize all public properties of generic type.<br>
  I've written the following method :</p>
  
  <pre><code>public static void EmptyModel&lt;T&gt;(ref T model) where T : new()
  {
      foreach (PropertyInfo property in typeof(T).GetProperties())
      {
          Type myType = property.GetType().MakeGenericType();
          property.SetValue(Activator.CreateInstance(myType));//Compile error
      }
  }
  </code></pre>
  
  <p>but it has a compile error<br></p>
  
  <p>how can I do it?</p>