I\'m using the BAGA code from Julie Lerman\'s DbContext book. I want to recreate the following SQL query in LINQ and put the results in a List collections and am having pro
Normally this is done using navigation properties which are loaded when you get the entity.
However you can also do this with the following:
(from d in baga.Locations
from l in Lodgings
where (d.LocationID == l.destination_id)
where (d.Country = 'usa' && (l.MilesFromNearestAirport > 5 || l.MilesFromNearestAirport == null))
select d)
.ToList();
I hope this will help to you.