title: LINQ Average TimeSpan?
body: <p>I have a database table that contains entries for start time and end time of an event. I would like to take those entries and find the average length of an event. The subtraction is no problem. However, when I try to get the average value, the compiler complains.</p>
  
  <p>Here is my current LINQ query:</p>
  
  <pre><code>public TimeSpan? getAverageTime()
      {
          return (from EventTime in db.EventTimes
                  where EventTime.EventTimesID &gt; 0
                  select (EventTime.TimeEnd - EventTime.TimeStart)).Average();
      }
  </code></pre>
  
  <p>I also tried .Sum() and .Aggregate() so that I could have something to work with, but none are accepted.</p>
  
  <p>What is the best method for accomplishing my goal?</p>