I have an interface defined as
public interface INamedReader
{
string DisplayInfoLine { get; }
string DisplayName { get; }
}
and a class which implements that interface but it is an internal class
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<TField>(ref TField field, TField value, [CallerMemberName] string propertyName = "");
}
and a class which implements the above NamedReader class
internal class NamedReaderDevice : NamedReader
{
public NamedReaderDevice();
public string Id { get; set; }
}
and now i defined class which implements INamedReader
public class ReaderDetails: INamedReader
{
public string DisplayInfoLine { get; }
public string DisplayName { get; }
}
I then created a function which return List.
public List<ReaderDetails> GetReaders
{
var readers = new List<ReaderDetails>();
var Ireaders = someobject.Getreaders();// Returns the list of NameReaderDevice (which is an internal class).
// Now i would like cast Ireaders as readers and return.
}
can someone please help me out in this, that would be great.