I have a query with a left join in it:
var query = (from v in context.Vehicles //left join vehicleAttributes join va in context.VehicleAttributes on v.VehicleId equals va.VehicleId into vAttributes from vehicleAttributes in vAttributes.DefaultIfEmpty() where v.FleetId == fleetId select new { v, vehicleAttributes });
And now I need to do the paging.
this works, but gets all the rows, much more than I really need
query.ToList().Select(x => xv).Distinct().Skip(10 * (page - 1)).Take(10).ToList();
this is what i tried instead, but now i don't have common values
query.Select(x => xv).Distinct().ToList().Skip(10 * (page - 1)).Take(10).ToList();
any ideas?
thanks
source share