title: Linq to Entities Left Outer Join/ Subquery?
body: <p>I have a query (developing in linqpad):</p>
  
  <pre><code>DateTime currentDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
  DateTime previousMonth = currentDate.AddMonths(-1);
  DateTime previousMonthForAveragePrices = currentDate.AddMonths(-2);
  
  
  var help =  from cd in CostDrivers.OfType&lt;Commodity&gt;() 
                                    where cd.isActive == true &amp;&amp; 
                                    cd.arePricesCalculatedAverage == false
                                    from cp in cd.CostDriverPrices where cp.priceDate
  == currentDate 
                                    select new {cd.costDriverID, cd.costDriverName, cd.isUpdatedMonthly, cd.arePricesCalculatedAverage,
                                                  cp.costDriverPriceID, priceDate = cp.priceDate,
                                                  cp.price, previousPriceDate = from cpc in cd.CostDriverPrices where cpc.priceDate == previousMonth 
                                                  select new {previousPrice = cpc.price, previousPriceDate = cpc.priceDate}};
  </code></pre>
  
  <p>help.Dump();</p>
  
  <p>What i need to do is return ALL costDrivers regardless of whether a price record exists on the given date (currentDate). I should point out there is an attempt at a subquery to grab another price record for a the currentDate -1 month.  I've tried || null etc. no go. This is linq to entities. The query itself works.. it will only return result where there is a price. thanks!</p>
  
  <p>thanks.</p>