So I have this database model :
Student<->StudentClasses<->Classes
where 1 student is linked to many StudentClasses and one Class is linked to many StudentClasses.
How do I write a LINQ query to get all the classes linked to the student with Id 1 ?
the following query throws an exception ("Can only specify query options (orderby, where, take, skip) after last navigation.") :
var qry = from sc in service.StudentClasses
where sc.StudentId == 1
from c in service.Classes
where c.ClassId == sc.StudentId
select c;