score:2

Accepted answer

As far as I am aware Include does not support this type of sub-querying. Your best option is to use projection e.g.

List<DevelopmentType> devTypes = 
           defaults.Include(x => x.DefaultCharges)
                   .Include(x => x.OverrideCharges)
                   .Select(x => new {
                        DevType = x.DevelopmentType,
                        Zones = x.OverrideCharges.Where(oc => oc.ChargingSchedule_RowId == cs.RowId)
                                                 .Select(oc => oc.Zone).ToList()
                   })
                   .Select(x => x.DevType)
                   .ToList();

Related Articles