title: Using LINQ to do some calculations on the current and the next object
body: <p>Is there an elegant solution to walk through an ordered list to do some calculations on the current and the next object? There must be a smarter way with LINQ to do the following:</p>
  
  <pre><code>public static List&lt;double&gt; GetHoursBetweenDates(List&lt;DateTime&gt; aDates)
  {
      List&lt;double&gt; lst = new List&lt;double&gt;();
      var olst = aDates.OrderByDescending(d =&gt; d).ToList();
      for (int i = 0; i &lt; olst.Count - 1; i++)
      {
          lst.Add(olst[i].Subtract(olst[i+1]).TotalHours);
      }
      return lst;
  }
  </code></pre>