public Section(List <Teacher> teachers, int sectionNo, int room, Timing classTiming, int commonHourRoom, Timing commonHourTiming) { SectionNo = sectionNo; Room = room; ClassTiming = classTiming; CommonHourRoom = commonHourRoom; CommonHourTiming = commonHourTiming; Teachers.AddRange(from x in teachers select TeacherGenerator.GenerateTeacher(x.Name)); }
IEnumerable <Section> CombineComponents(List <IntermediateStructure> sections) { foreach (var x in sections) { var section = new Section { ClassTiming = x.time, CommonHourRoom = -1, CommonHourTiming = Timing.GenerateEmptyTiming, Room = -1, SectionNo = x.Section }; section.Teachers.AddRange(from y in x.Teachers select TeacherGenerator.GenerateTeacher(y)); yield return(section); } }