I changed my code from:
var periodTasks = tasks.Where(t => t.EmployeeFk == employee.Id && t.Start >= extractStart && t.Start < extractEnd);
if (periodTasks.Count()==0) continue;
to
var periodTasks = tasks.Where(t => t.EmployeeFk == employee.Id && t.Start >= extractStart && t.Start < extractEnd);
if (!periodTasks.Any()) continue;
and now I get:
System.ArgumentOutOfRangeException occurred
Message="Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"
Source="mscorlib"
ParamName="index"
StackTrace:
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
InnerException:
Not sure if this is just me using LinQ incorrectly or an LLBLGenPro issue