LINQ - joining multiple lists

Posted by kristian on Stack Overflow See other posts from Stack Overflow or by kristian
Published on 2009-04-15T14:47:01Z Indexed on 2010/05/20 23:50 UTC
Read the original article Hit count: 159

Filed under:
|

I've looked at the 101 Linq Samples here but I can't see anything like this in that list. If I'm just not seeing a relevant example there, please link to it.

If I have these 3 classes:

class Student { int id; string name }
class Course { int id, string name }
class Enrolment { int studentId; int courseId; }

How would I use LINQ to get a list of courses a student is enrolled on? (assume I have an IList of all three classes)

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about c#