Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created May 24, 2022 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgolubyev/b2e7a44defea5fd6b35c791cce4e9da1 to your computer and use it in GitHub Desktop.
Save lgolubyev/b2e7a44defea5fd6b35c791cce4e9da1 to your computer and use it in GitHub Desktop.
class CarEngineData
{
public string Displacement { get; }
public string Horses { get; }
public EmployeeTaxData(string displacement, string horses)
{
Displacement = displacement;
Horses = horses;
}
// ...
}
class Car
{
public string Model { get; }
public string Brand { get; }
public CarEngineData EngineData { get; }
public Car(string model, string brand)
{
Model = model;
Brand = brand;
}
public void SetEngine(string displacement, double horses)
{
EngineData = new CarEngineData(displacement, horses);
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment