Something else that needs sorted on the FindByLocation() method is the lambda expression.
Code:
var dinners = from dinner in FindUpcomingDinners()
join i in NearestDinners(latitude, longitude)
on dinner.DinnerID equals i.DinnerID
select dinner;
Will highlight an error on
Code:
NearestDinners(latitude, longitude)
unless you include the following method (in the downloaded final solution this method is included immediately below the
public static double DistanceBetween() stub function in DinnerRepository.cs)
Code:
public IQueryable<Dinner> NearestDinners(double latitude, double longitude)
{
return from d in entities.Dinners
where DistanceBetween(latitude, longitude, d.Latitude, d.Longitude) < 100
select d;
}