title: Group by ID in List object
body: <p>Hi I'm trying to use LINQ to group some data that I got back. Data:</p>
  
  <pre><code>[
    {
      "TicketID": 11,
      "Priority": 1,
      "Email": "someemail@asdf.com",        
      "Files": [
        {
          "FileID": 1,
          "FileName": "file1.png"
        }
      ]
    },
    {
      "TicketID": 11,
      "Priority": 1,
      "Email": "someemail@asdf.com",        
      "Files": [
        {
          "FileID": 2,
          "FileName": "file2.png"
        }
      ]
    },
    {
      "TicketID": 11,
      "Priority": 1,
      "Email": "someemail@asdf.com",        
      "Files": [
        {
          "FileID": 3,
          "FileName": "file3.png"
        }
      ]
    },
  ]
  </code></pre>
  
  <p>Is it possible to group like this:</p>
  
  <pre><code>[
    {
      "TicketID": 11,
      "Priority": 1,
      "Email": "someemail@asdf.com",        
      "Files": [
        {
          "FileID": 1,
          "FileName": "file1.png"
        },
        {
          "FileID": 2,
          "FileName": "file2.png"
        },
        {
          "FileID": 3,
          "FileName": "file3.png"
        }
      ]
    }
  ]
  </code></pre>
  
  <p>I tried to use LINQ:</p>
  
  <pre><code>var newList = list.GroupBy(gb =&gt; gb.TicketID).SelectMany(s =&gt; s);
  </code></pre>
  
  <p>But it's getting the same output as the original. Maybe someone would know.
  Thanks!</p>