title: C#: Upper cast - List<Interface> to List<Class> - cast obejct of internal class
body: <p>I have an interface defined as </p>
  
  <pre><code>public interface INamedReader
  {
       string DisplayInfoLine { get; }
       string DisplayName { get; }
  }
  </code></pre>
  
  <p>and a class which implements that interface but it is an internal class</p>
  
  <pre><code>internal class NamedReader : INamedReader, INotifyPropertyChanged
      {
          public NamedReader();
  
          public string DisplayInfoLine { get; set; }
          public string DisplayName { get; set; }
  
          public event PropertyChangedEventHandler PropertyChanged;
  
          public override string ToString();
          protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = "");
          protected virtual bool Set&lt;TField&gt;(ref TField field, TField value, [CallerMemberName] string propertyName = "");
      }
  </code></pre>
  
  <p>and a class which implements the above NamedReader class </p>
  
  <pre><code>internal class NamedReaderDevice : NamedReader
  {
      public NamedReaderDevice();
  
      public string Id { get; set; }
  }
  </code></pre>
  
  <p>and now i defined class which implements INamedReader</p>
  
  <pre><code>public class ReaderDetails: INamedReader
  {
       public string DisplayInfoLine { get; }
  
       public string DisplayName { get; }
  }
  </code></pre>
  
  <p>I then created a function which return List.</p>
  
  <pre><code>public List&lt;ReaderDetails&gt; GetReaders
  {
       var readers = new List&lt;ReaderDetails&gt;();
       var Ireaders = someobject.Getreaders();// Returns the list of NameReaderDevice (which is an internal class).
       // Now i would like cast Ireaders as readers and return.
  }
  </code></pre>
  
  <p>can someone please help me out in this, that would be great.</p>