title: Interface with a list of interface, how to choose one type implemented by interface
body: <p>This is my first question on StackOverflow, so please forgive and tell me if I'm doing something wrong.</p>
  
  <p>Problem:</p>
  
  <p>I write some kind of dictionary connected to DB and text files etc. nothing commercial, just learning. For better explanation it can be English-French.</p>
  
  <p>I want to refactor the code to have possibility of use one "general" method to process entrance for English-French and French-English dictionary model. On the begining i made separate model for each of them(I will paste if necessary) and now i would like to make everything "universal". What I did till i stop:</p>
  
  <pre><code>public interface IWordModel 
  {
  
      int Id { get; set; }
      string Name { get; set; }
      string Definition { get; set; }
  }
  </code></pre>
  
  <p>class implementing IWordModel:</p>
  
  <pre><code>public class EnglishWordModel: IWordModel
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public string Definition { get; set; } = null;
  }
  public class FrenchWordModel : IWordModel
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public string Definition { get; set; } = null;
  }
  </code></pre>
  
  <p>Interface implementing IWordModel and problematic List of this interface:</p>
  
  <pre><code>public interface IDictionairyModel&lt;T&gt; where T : IWordModel
  {
      int Id { get; set; }
      T BaseWord { get; set; }
      List&lt;T&gt; DerivativeWords { get; set; }
  }
  </code></pre>
  
  <p>Class implementing IDicionairyModel </p>
  
  <pre><code>public class EnglishFrenchDictionairyModel&lt;T&gt;: IDictionairyModel where T : IWordModel
  {
      public int Id { get; set; }
      public IWordModel BaseWord { get; set; } = new EnglishWordModel();
      public List&lt;IWordModel&gt; DerivativeWords { get; set; } =  = new 
      List&lt;IWordModel&gt;(new List&lt;FrenchWordModel&gt;());
  }
  public class FrenchDictionairyModel: IDictionairyModel&lt;T&gt; where T : IWordModel
  {
      public int Id { get; set; }
      public IWordModel BaseWord { get; set; } = new FrenchWordModel();
      public List&lt;IWordModel&gt; DerivativeWords { get; set; } =  = new 
      List&lt;IWordModel&gt;(new List&lt;EnglishWordModel&gt;());
  }
  </code></pre>
  
  <p>And my Question</p>
  
  <ol>
  <li><p>How to make that i.e in FrenchDictionairyModel instance we will be able to define BaseWord only as FrenchWordModel and add to DerivativeWords list ONLY EnglishWordModel? I know it have something common with covariance and contrvariance but i dont have idea how to apply this here.</p></li>
  <li><p>Is it above code have some sense from experienced coder point of view or it's look like OK only in my head? If answer is NO then how it should look like, what pattern should i use?</p></li>
  <li><p>How to use it properly in other methods? As now i was using i.e  </p>
  
  <pre><code>public List&lt;EnglishFrenchDictionairyModel&gt; 
  CreateEnglishFrenchEntrance(List&lt;EnglishFrenchDictionairyModel&gt; model){     
  </code></pre>
  
  <p>( ... )}</p>
  
  <p>but its already showing "Using generic type requires 1 type arguments".</p></li>
  </ol>
  
  <p>Thanks and have a Great Day!</p>