Applying group by in a LINQ Query, the information required in further join is lost
|Added at||2016-12-31 12:12|
I have the following models:
Each Course is taught in many Course_TutionCenter and each Course can have many CourseStudent which are distributed over several Course_TutionCenter.
I need the following data in a single LINQ query:
CourseId, Course Name, Number of Tution Centers Offering This Course, Number of Students taking this Course over all Tution Centers
I have not able to fetch this data using a single LINQ query, because in applying group by over Course in the join of (Course and Course_TutionCenter), the informtation to get the count of Total students over all Tution Centers is lost, because we don't have the IDs of several Tution Centers after applying group by over Course.Id in the join of Course and Course_TutionCenter
Can this be done using single LINQ query?