Assuming I have the following classes
class Vehiculo
{
public string Nombre { get; set; }
}
class Auto : Vehiculo
{
public string CantidadRuedas { get; set; }
}
and what I want to do is the following
Vehiculo vehiculo = new Auto();
// Como acceder a las propiedades de auto?
// al intentar hacer lo siguiente intellisense me dice que vehiculo no tiene tal propiedad
Console.log(vehiculo.CantidadRuedas);
// al intentar usar un cast me sigue sin reconocer la propiedad
Console.log((Auto)vehiculo.CantidadRuedas);
The question is: how do I access the properties of the child element in that case?