add item to object c# code example
Example: add items to a class array
class Student
{
IList<Subject> subjects = new List<Subject>();
}
class Subject
{
string Name;
string referenceBook;
}
//Now you can say:
someStudent.subjects.Add(new Subject());