Keep the person class as is.
class Person { public string FirstName { get; set; } public string LastName { get; set; } }
Create a Student
class from Person
and add the School property.
class Student : Person { public string School { get; set; } }
Now you can add Student
to the Person
s list.
var persons = new List<Person>(); persons.Add(new Student());
source share