If I inherit from a base class and want to pass something from the constructor of the inherited class to the constructor of the base class, how do I do that?
public class Car
{
public Car(string model)
{
Console.WriteLine(model);
}
}
public class Mercedes : Car
{
public Mercedes(string model): base(model)
{
}
}
Usage:
Mercedes mercedes = new Mercedes("CLA Shooting Brake");