Created
June 11, 2015 15:58
-
-
Save jordan112/a5b1b352c2831717c013 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IQueryable<CoursesBySectionViewModel> GetCoursesBySection() | |
{ | |
return from cs in this.courseSectionRepository.GetAll() | |
join staffmem in staffRepository.GetAll() on cs.CourseSectionID equals staffmem.CourseSectionID | |
select new CoursesBySectionViewModel | |
{ | |
AcademicYearId = cs.AcademicYearID, | |
SchoolId = cs.SchoolID, | |
CourseSectionId = cs.CourseSectionID, | |
SectionName = cs.CourseSectionDescription, | |
GradeLevelId = cs.GradeLevelID, | |
GradeLevelName = cs.GradeLevelID.ToString(), | |
SectionNumber = cs.GradeLevelID + "A" | |
}; | |
//return this.courseSectionRepository.GetAll().Project().To<CoursesBySectionViewModel>(); | |
} | |
// you can also use the automapper technique as well, then you need simpler expressions such as | |
return this.courseSectionRepository.GetAll().Project().To<CoursesBySectionViewModel>(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment