I have an interface defined as
public interface IReaderInfo
{
string Displayname {get;}
}
and a class that implements that interface
public class ReaderInfo : IReaderInfo
{
string DisplayName {get;}
}
I then created a function which return List
public List<ReaderInfo> GetReaders
{
var readers = new List<ReaderInfo>();
var Ireaders = someobject.Getreaders();// Returns the list of IReaderInfo.
// Now i would like cast Ireaders as readers and return.
}
How do i cast it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…