title: Group And Average Timespans By Week
body: <p>I have a number of records with various DateTimes, but I need to track these in a graphical layout. I currently have managed to retrieve the timespan of each record</p>
  
  <pre><code>List&lt;myclass&gt; recs = context.myclass.Where(c =&gt; c.RequestedTimestamp &gt;= start &amp; c.DeliveredTimestamp &lt;= end).ToList();
  
  foreach (var item in recs) 
  {
      TimeSpan diff = (TimeSpan)(item.DeliveredTimestamp - item.RequestedTimestamp);
  
      //more to come, this is where I realized I have issues
  }
  </code></pre>
  
  <p>This of course,  will return me a list of timespans, but that in itself is not very helpful.</p>
  
  <p>How would this be better approached in order to achieve a list of weekly (or monthly) average of these timespans.</p>
  
  <p>The problem I consider is that timespans forget their start and end points, therefore whilst these can be averaged, how is the averaging going to be performed in a grouped approach?</p>
  
  <p>The output; an average timespan for a group of DateTimes, is to be hooked into a chart for a visual display.</p>