Hi,
Bumped into a strange situation here. Trying to extract cars from a sql database within a certain range of a position (lat/long) and return an IQueryable to do additional logic on the resultset afterwards.
public IQueryable<Car> QueryAllCarsByDistance(float latitude, float longitude, int distance)
{
var cars = from car in QueryAllCars()
join i in sqlContext.QueryContactsByDistance(latitude, longitude, distance)
on car.ContactId equals i.Id
orderby i.Distance
select car;
return cars;
}
QueryContactByDistance beeing a function in the SQL database and QueryAllCars just returns all cars from database.
My question is now: How do I append the Distance (i.Distance) to car? I don't want to do a select new Car { Distance = i.Distance, Id = car.Id, ... }. But how to just append this additional value to the car object?