I have a set of tasks that I need to select distinct on (group by in L2E). Those tasks have a referenced property, "Activity" that I need to be loaded so that I can reference the task.Activity object. In the first example below, this works fine. However, when I group by the description, the activity does not get loaded. What am I missing?
tasks =
(from x in Db.Task.Include("Activity") select x)
.ToList();
tasks =
(from x in Db.Task.Include("Activity")
group x by x.Description
into groupedByDescription
select groupedByDescription.FirstOrDefault()).ToList();