using System.Collections.Generic;
public static void Main()
List<Student> students = new List<Student>();
students.Add(new Student()
Address = "Metropolitan Council",
Guardian = new Guardian()
Address = "Bunker Street",
students.Add(new Student()
Address = "Sederal Low Cost",
Guardian = new Guardian()
WorkPhone = "23432432423"
foreach (var x in students)
public interface IIndividual
string Name { get; set; }
string Number { get; set; }
string Address { get; set; }
public interface IGuardian: IIndividual
string WorkPhone { get; set; }
public class Student: IIndividual
public IGuardian Guardian { get; set; }
public string Name { get; set; }
public string Number { get; set; }
public string Address { get; set; }
public override string ToString()
return $"Name:{Name}\nNumber:{Number}\nAddress:{Address}\nGuardian:\n{Guardian}";
public class Guardian: IGuardian
public string Name { get; set; }
public string Number { get; set; }
public string Address { get; set; }
public string WorkPhone { get; set; }
public override string ToString()
return $"Name:{Name}\nNumber:{Number}\nAddress:{Address}\nWorkPhone{WorkPhone}";