12-week staffing forecast LINQ query
You are combining an IQueryable with a local sequence, dates. It is possible to do that, but Entity Framework1 needs a lot of code to convert the sequence into something that behaves like a SQL table. I'm sure this is a major performance killer.

From what I see, you can do without this local sequence. You know the begin and end date. So it's possible to get the forecasts between those dates. If you group those forecasts by their Date, you achieve the same grouping:

from r in context.StaffingResourceDatas 
where r.EmployeeId != null &amp;&amp; !exclusionList.Contains(r.ResourceTitleId)
let forecasts = context.StaffingForecasts
                       .Where(f =&gt; r.ResourceId == f.ResourceId
                                &amp;&amp; f.Date &gt;= start &amp;&amp; f.Date &lt;= end)
select new ChartResourceModel
{
    ResourceId = r.Key.ResourceId,
    Division = r.Key.ResourceDivision,
    Type = r.Key.ResourceType,
    Dates = (from fc in forecasts
             group fc by d.Date into fcg
             select new ChartDateModel
             {
                 Date = fcg.Key,
                 Available = fcg.Sum(f =&gt; f.Hours) &lt; 24
             })
}




1 I assume this is EF, because Linq-to-Sql doesn't allow local sequences in a LINQ query.