title: Exception when using LINQ SUM
body: <p>I'm trying to get the SUM of "bookings" and I get error "The cast to value type 'Int32' failed because the materialized value is null. Either the result type's generic parameter or the query must use a nullable type."</p>
  
  <pre><code>var bookings = entities.Bookings.Where(x =&gt; x.ID == id &amp;&amp;
                                       x.StartDate &lt;= bookingEnd &amp;&amp;
                                       x.EndDate &gt;= bookingStart)
                                      .Sum(x =&gt; x.BookingQuantity);
  </code></pre>
  
  <p>How shall I fix this? I need to get 0 if it ever gets to be null else its bookings.</p>