title: Left outer join in EF lambda expression
body: <p>I have the following EF query that returns a list of usage data on only the days present in the DB.</p>
  
  <pre><code>var DailyUsage = context.UsageData.Where(u =&gt; u.UserID == CurrentUser.ID &amp;&amp; u.Date &gt;= Start &amp;&amp; u.Date &lt;= End)
                                    .Select(p =&gt; new PerfData
      {
          Date = p.Date,
          Transfers = p.Transfers,
          Exists = p.Exists,
          Duration = p.Duration
      }).ToList();
  </code></pre>
  
  <p>I'd like it to return a list with an uninterrupted date sequence with data points at 0 for inexistent dates in the DB so I am trying to do a left outer join with the following list of dates but can't seem to get it right:</p>
  
  <pre><code>public static List&lt;DateTime&gt; GetDateRange(DateTime startingDate, DateTime endingDate)
  {
      if (StartingDate &gt; EndingDate)
      {
          return null;
      }
      List&lt;DateTime&gt; rv = new List&lt;DateTime&gt;();
      DateTime tmpDate = startingDate;
      do
      {
          rv.Add(tmpDate);
          tmpDate = tmpDate.AddDays(1);
      }
      while (tmpDate &lt;= endingDate);
      return rv;
  }
  </code></pre>