title: Selecting specific columns from GroupBy list
body: <p>Model:</p>
  
  <pre><code>public class Ticket {
      public Ticket();
  
      public int Id { get; set; }
      public virtual TicketUrgency TicketUrgency { get; set; }
      public int UrgencyId { get; set; }   
  }
  
  public class TicketUrgency {
      public TicketUrgency();
      [Key]
      public int Id { get; set; }
      [MaxLength(50)]
      [Required]
      public string Name { get; set; }
      public ICollection&lt;Ticket&gt; Tickets { get; set; }
  }
  </code></pre>
  
  <p>I have the following linq statement:</p>
  
  <pre><code> var model = Entities
                  .Include(x =&gt; x.TicketUrgency)
                  .GroupBy(x =&gt; x.UrgencyId)
                  .Select(g =&gt; new {
                      id = g.Key,
                      count = g.Count(),
                      name = g.FirstOrDefault(u =&gt; u.UrgencyId == g.Key).TicketUrgency.Name
                  });
  </code></pre>
  
  <p>I want to Group <code>Entities</code> by <code>UrgencyId</code> and then return the Key (<code>UrgencyId</code>), and also count of the items in a single group and show the name of the Urgency.</p>
  
  <p>When I run it, the query just gets hung up without any exceptions. </p>