PI06 i PI06-1. Docker definitions for MSSQL and Postgres. Data seeder/generator for countries and people. Entity Framework example with variants for Postgres and MSSQL
This commit is contained in:
31
SomeOfCSharpFeatures/Inheritance/Car.cs
Normal file
31
SomeOfCSharpFeatures/Inheritance/Car.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
namespace Inheritance;
|
||||
|
||||
public class Car : Vehicle
|
||||
{
|
||||
public int Doors { get; set; }
|
||||
public string Color { get; set; } = "White";
|
||||
|
||||
public Car(string model, double horsePower, int doors)
|
||||
: base(model, horsePower)
|
||||
{
|
||||
Console.WriteLine($"Creating car {model}");
|
||||
this.Doors = doors;
|
||||
}
|
||||
|
||||
public void BuckleSeatBelt()
|
||||
{
|
||||
Console.WriteLine("Car {0} - seat belt buckled", Model);
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
Console.WriteLine("Start Car " + Model);
|
||||
}
|
||||
|
||||
public new void Stop()
|
||||
{
|
||||
Console.WriteLine("Stop Car " + Model);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user