I am doing the following LINQ Query which works but doesn't return the navigation property Person filled, I get null
.
public IEnumerable<SharePeople> GetSharePeopeByCarId(int carId)
{
return from q in _context.Cars
join s in _context.Shares
on q.CarId equals s.Car.CarId
join p in _context.SharePeople.Include(p => p.Person)
on s.ShareId equals p.ShareId
where q.CarId == carId
select p;
}
I have no idea why, since when I do the regular extension method like _context.SharePeople.Include(p => p.Person)
it works.