In C#, what is the best way to access a property of the derived class when the generic list contains just the base class.
public class ClassA : BaseClass {
BaseClass o = MyList[i]; if (o is ClassB) { object k = ((ClassB)o).PropertyB; } if (o is ClassA)) { object j = ((ClassA)o).PropertyA; }