title: Cannot convert or cast a List into another one using as operator or simple cast
body: <p>Let's code a program sorting <em>friendy</em> and <em>nasty</em> people. All are <em>characters</em> and have a <em>name</em>.</p>
  
  <p>We can represent this as follow :</p>
  
  <pre><code>interface ICharacter
  {
      string GetName();
  }
  
  class Character : ICharacter
  {
      private readonly string name;
  
      public Character(string name)
      {
          this.name = name;
      }
  
      public string GetName()
      {
          return this.name;
      }
  }
  
  
  class Friendly : Character
  {
      public Friendly(string name) 
          : base(name)
      {
  
      }
  }
  
  class Nasty : Character
  {
      public Nasty(string name)
          : base(name)
      {
  
      }
  }
  
  </code></pre>
  
  <p>Now let's declare and store our characters into a Dictionary this way :</p>
  
  <pre><code>Dictionary&lt;Type, IList&lt;ICharacter&gt;&gt; characters = new Dictionary&lt;Type, IList&lt;ICharacter&gt;&gt;();
  
  characters.Add(typeof(Friendly), new List&lt;ICharacter&gt;() { new Friendly("friendly1"), new Friendly("friendly2") });
  characters.Add(typeof(Nasty), new List&lt;ICharacter&gt;() { new Nasty("nasty1"), new Nasty("nasty2") });
  
  </code></pre>
  
  <p>Now we can code a method extracting all friendy people from dictionary as a list of friendly people and NOT a list of characters :</p>
  
  <pre><code> public static List&lt;Friendly&gt; GetFriendlyPeople(Dictionary&lt;Type, IList&lt;ICharacter&gt;&gt; allPeople)
   {
       if (allPeople.TryGetValue(typeof(Friendly), out IList&lt;ICharacter&gt; friendly)) {
           return friendly as List&lt;Friendly&gt;; //(List&lt;Friendly&gt;)friendly the same result
       }
       return new List&lt;Friendly&gt;();
   }
  
  </code></pre>
  
  <p>Finally, we can call the method GetFriendlyPeople :</p>
  
  <pre><code>List&lt;Friendly&gt; friends = GetFriendlyPeople(characters);
  
  </code></pre>
  
  <p>But the return value is <em>null</em>. I tried several combination using interface or not and it's the same result.</p>