:
, . , , , , , .
, , .
c# classes properties , :
class StaffMember
{
public string Name { get; set; }
public string Address { get; set; }
public DateTime DateStarted { get; set; }
public Department Department { get; set; }
}
class Department
{
public string Name { get; set; }
public Position Position { get; set; }
}
class Position
{
public string Title { get; set; }
public string PrimaryRole { get; set; }
}
:
static void Main()
{
StaffMember employee = new StaffMember();
employee.Name = "Ali Gray";
employee.Address = "123 Abc Street";
employee.DateStarted = DateTime.Now;
employee.Department = new Department();
employee.Department.Name = "Checkout";
employee.Department.Position = new Position();
employee.Department.Position.Title = "Bag Packer";
employee.Department.Position.PrimaryRole = "Pack bags";
}
, , , , oo design.