LINQ To Entities + Include + Anonymous type issue
As Ladislav mentioned, Include only works if you select the Ticket entity directly. Since you’re projecting other information out, the Include gets ignored. This should provide a good work-around: var data = ctx.Set<Ticket>() .Select(p => new { Ticket = p, Clients = p.Client, LastReplyDate = p.Replies.Max(q => q.DateCreated) }); First of all, each Ticket’s Clients … Read more