I have 2 classes, one inherit from anotherone
public class A
{
public string prop1 { get; set; }
public string prop2 { get; set; }
public string prop3 { get; set; }
}
public class B : A
{
public string prop4 { get; set; }
}
Now I create a List of class B and cast it into a type of class B
List<B> BList = new List<B>();
BList = new List<B>() { new B() { prop1 = "1", prop2 = "2", prop3 = "3", prop4 = "4" } };
List<A> AList = BList.Cast<A>().ToList();
But when I debug, there is still a reference to class B:
How can I remove / avoid the display of properties from the base class?