title: Combining consecutive dates into ranges
body: <p>I have a List of objects</p>
  
  <pre><code>public class sample
  {
   public DateTime Date;
   public string content;
  }
  </code></pre>
  
  <p>I want to be able to create a list of new objects </p>
  
  <pre><code>public class sampleWithIntervals
  {
   public DateTime startDate;
   public DateTime endDate;
   public string content;
  }
  </code></pre>
  
  <p>The sample objects should be grouped into intervals based on the content. The intervals can include only those dates that are included in the original sample list.
  I dont know how to do this in Linq.</p>
  
  <p>Sample data:</p>
  
  <pre><code>{"10/1/2013", "x"}
  {"10/2/2013", "x"}
  {"10/2/2013", "y"}
  {"10/3/2013", "x"}
  {"10/3/2013", "y"}
  {"10/10/2013", "x"}
  {"10/11/2013", "x"}
  {"10/15/2013", "y"}
  {"10/16/2013", "y"}
  {"10/20/2013", "y"}
  
  This should give me 
  {"10/1/2013","10/3/2013", "x"}
  {"10/2/2013","10/3/2013", "y"}
  {"10/10/2013","10/11/2013", "x"}
  {"10/15/2013","10/16/2013", "y"}
  {"10/20/2013","10/20/2013", "y"}
  </code></pre>