title: How to group a list of lists by date using Linq?
body: <p>Here is a simplified version of my class structure:</p>
  
  <pre><code>public class TransferObject
  {
      public List&lt;Event&gt; events { get; set; }
  
      public TransferObject()
      {
          events = new List&lt;Event&gt;();
      }
  }
  
  public class Event
  {
      public List&lt;Data&gt; eventData { get; set; }
  
      public Event()
      {
          eventData = new List&lt;Data&gt;();
      }
  }
  
  public class Data
  {
      public int someData {get; set;}
      public DateTime date { get; set; }
  }
  </code></pre>
  
  <p>What I want to do is take all the <code>Data</code> objects in the <code>eventData</code> lists and put them in a new grouped list of lists that's grouped by <code>date</code>.</p>
  
  <p>I thought about putting all the <code>Data</code> objects into a temporary list and then grouping that list with Linq but I'd like to know if there's a more elegant way to do it without using a temporary list.</p>