title: Specifying constructor constraint for Generic Parameter
body: <p>I have a collection of objects which I pass as parameter to create objects of another type (one for one). I am doing this in many places (basically converting from data objects to business objects). I want to write a generic extension method to accomplish this. But I am stuck because I don't know how I can specify constraint that business object has a constructor taking data object as parameter. Following is code of my function:</p>
  
  <pre><code>public static IList&lt;T&gt; ConvertTo&lt;A,T&gt;(this IEnumerable&lt;A&gt; list) 
                      where T : new(A)/*THIS IS PROBLEM PART*/
  {
      var ret = new List&lt;T&gt;();
  
      foreach (var item in list)
      {
          ret.Add(new T(item));
      }
      return ret;
  }
  </code></pre>