title: Call constructor in abstract class with generics
body: <p>I have the following base class which is abstract:</p>
  
  <pre><code>public abstract class MasterDataViewModel&lt;TPrimaryModel&gt; : ViewModel
      where TPrimaryModel : TwoNames, new()
  {
      ...
  }
  </code></pre>
  
  <p>I have some derived classes like:</p>
  
  <pre><code>public class ConsignorViewModel : MasterDataViewModel&lt;Consignor&gt;
  {
      protected override void Find()
      {           
          ...
          foreach (Consignor consignor in consignors)
          {
              ConsignorViewModel viewModel = new ConsignorViewModel(consignor, consignor.Address);
              SearchResults.Add(viewModel);
          }
          ...
  
      }
  }
  </code></pre>
  
  <p>I would like to move the Find method to my base class. The problem is the constructor call which is not possible in my abstract class. It has to be something like this:</p>
  
  <pre><code>protected override void Find()
  {         
      ...
      foreach (TPrimaryModel primaryModel in results)
      {
          MasterDataViewModel&lt;TPrimaryModel&gt; viewModel = new MasterDataViewModel(primaryModel, primaryModel.Address);
          SearchResults.Add(viewModel);
      }
      ...
  }
  </code></pre>
  
  <p>It's not working as constructor calls in abstract classes are not allowed. Any other solution? I thought about another generic. Problem is that a new constraint cannot have any parameters so this doesn't work, too.</p>