private static SectionDisplayObject MapSectionToSectionDisplayObject(Course c, string sectionId) { var newSection = new SectionDisplayObject(); if (c != null) { newSection.id = sectionId; newSection.courseTitle = c.courseTitle; newSection.courseDescription = c.courseDescription; newSection.courseLevel = c.courseLevel; newSection.subjectArea = c.subjectArea; } return newSection; }
private static IEnumerable<SectionDisplayObject> MapSectionToSectionDisplayObject(IEnumerable<Section> sections) { var newSections = new List<SectionDisplayObject>(); foreach (var s in sections) { var newSection = new SectionDisplayObject(); newSection.courseTitle = s.course.courseTitle; newSection.courseDescription = s.course.courseDescription; newSection.courseLevel = s.course.courseLevel; newSection.subjectArea = s.course.subjectArea; newSections.Add(newSection); } return newSections; }