I am not strong in OOP. Help me design the classes correctly.
SchoolReport.cs
public class SchoolReport { public string SchoolName { get; set; } public string AreaName { get; set; } public List<LearnerReport> LearnerReports { get; set; } } LearnerReport.cs
public class LearnerReport //Лист оценки обучающегося { //данные обучающегося public string SNS { get; set; } //ФИО участника public string ClassName { get; set; } } LearnerReport_201636.cs
//2016-36 - Готовность 1 классов 2016/2017 public class LearnerReport_201636 : LearnerReport { public double? PrimaryMark { get; set; } public string OldGroupName { get; set; } //Возрастная группа: 6-7 лет/7-8 лет public string WasOrWasntDOO_str { get; set; } //ДА/НЕТ public string WasOrWasnt_str { get; set; } //ДА/НЕТ public string TestResult5Name { get; set; } //Какая группа на основе тестового балла public string ValueArray { get; set; } //Баллы за задания = 1;1;0;0;1... } SchoolReport_201636.cs
public class SchoolReport_201636 : SchoolReport { } As you can see in the SchoolReport there is a композиция . How do I now correctly in the specific implementation of SchoolReport_201636 point to a specific implementation of LearnerReports_201636 ?
I try to do it like this:
Program.cs
SchoolReport schoolReport = new SchoolReport_201636(); schoolReport.LearnerReports = new List<LearnerReport_201636>(); //ТУТ ОШИБКА but on the second line of the code, the medium shows:
What am I doing wrong?

public List<LearnerReport> LearnerReports? - GrundyLearnerReportobjects that will be formed from DB rows. - AdamLearnerReport_201636? - GrundySOLID, then probably any. - AdamLearnerReportfrom other schools can be added toLearnerReport? - Grundy