public List <T> DisplayRestaurants <T>(List <T> restaurant) { RestaurantsDbEntities dbutilities = new RestaurantsDbEntities(); var query = from r in dbutilities.Restaurants select r; foreach (var item in query) { Console.WriteLine(item); } return(restaurant); }
public void DisplayTop3() { RestaurantsDbEntities dbutilities = new RestaurantsDbEntities(); var query = (from r in dbutilities.Restaurants orderby r.AvgRating descending select r).Take(3); Console.WriteLine("Here are the top 3 Restaurants:"); foreach (var item in query) { Console.WriteLine(item); } }
public void DisplayReviews <T>(List <T> review) { Console.WriteLine("Which reviews would you like to see: "); var desired = Console.ReadLine(); RestaurantsDbEntities dbutilities = new RestaurantsDbEntities(); var query = from r in dbutilities.Reviews where r.Restaurant.Equals(desired) select r; foreach (var item in query) { Console.WriteLine(item); } }