title: Add GroupBy to Select
body: <p>I have this query</p>
  
  <pre><code>[HttpGet]
  public List&lt;AttachedPhotosModel&gt; GetReportAttachedPhotos(int reportId)
  {
    var photos = new ReportsRepository().GetInjuryPhotos(reportId);
  
    return photos.Select(x =&gt; new AttachedPhotosModel()
    {
      Id = x.Id,
      Type = x.InjuryType,
      Photos = photos.Where(y =&gt; y.InjuryType == x.InjuryType).Select(z =&gt; z.ServicePhotoUrl).ToList()
    }).ToList();
  }
  </code></pre>
  
  <p>I need to GroupBy InjuryType, how to do this?</p>
  
  <p>I added <code>return photos.GroupBy(k =&gt; k.InjuryType).Select(x =&gt; new AttachedPhotosModel()</code> but how to select model, <code>x</code> have new value <code>key</code> and I don't know how to select my data</p>