New work and the test is as follows
I have this function that receives a parameter of type (DbGeography) which selects a set of results and returns a list, now what I need is to change the parameter by (int RestaurantID) and make the same selection but according to this field (I know .. It may not be necessary to return a list since only one record is going to be selected ... but it's for now to be done that way ... then I have to change it)
public List<VistaRestaurantSearch> SearchRestaurant(DbGeography geografi)
{
List<VistaRestaurantSearch> vista = new List<VistaRestaurantSearch>();
var rest = (from de in se.DeliveryConfiguration join re in se.restaurant on de.Restaurantid equals re.RestaurantID
where (de.Position.Distance(geografi)/1000) < de.Distance select re).ToList();
foreach (var item in rest)
{
vista.Add(new VistaRestaurantSearch() {
restaurant = item,
config = se.DeliveryConfiguration.Where(a => a.Restaurantid == item.RestaurantID).FirstOrDefault(),
Horary = new EngineRestaurant().getRestaurantHourbyRestaurant(item.RestaurantID),
prom = new EngineReview().getReviewAverage(item.RestaurantID)
});
}
return vista;
}