title: Nested Selects in LINQ
body: <p>I have the following model:</p>
  
  <p>Schools with Many Majors
  Majors with Many Offered Degrees (or just Degrees for Short).</p>
  
  <pre><code>+------+--------+--------+
  |School| Major  | Degree |
  +------+--------+--------+
  | UCLA |CompSci | B      |
  | UCLA |CompSci | M      |
  | UCLA |CompSci | D      |
  | UCLA |Math    | B      |
  +------+--------+--------+
  </code></pre>
  
  <p>I'd like to retrieve all the degrees offered by a school, grouped by Majors (so majors is not repeated for each degree returned). How might I do that? I have the following code so far, but now I'm stuck.</p>
  
  <pre><code>var query = from school in schools
              where school.Id == Id
              select new
              {
                  name   = s.Name
                  majors = (from major in school.Majors
                           select new
                           {
                               majorname = major.Name
                           }).Distinct()
              };
  </code></pre>
  
  <p>I'm not quite sure I know how to return the degrees for each distinct major.</p>