public IEnumerable <Restaurant> GetAll(Expression <Func <Restaurant, bool> > where = null) { var res = where == null ? _RestaurantRepo.GetAll() : _RestaurantRepo.GetAll().AsQueryable().Where(where); return(res); }
public void AddTestRestaurant() { if (_restaurantRepo.GetAll().Count() > 0) { return; } var generic1 = CreateTestRestaurant("generic restaurant 1", RestaurantType.FastFood, "Generic Food", 20.5, "9-5", "6666 generic ave", "picture1.jpg", false, "www.generic.com", "555-5555", true, " "); var generic2 = CreateTestRestaurant("generic restaurant 2", RestaurantType.Buffet, "Generic buffet Food", 15, "9-12", "7777 generic ave", "picture2.jpg", true, "www.generic2.com", "666-6666", false, " "); var real = CreateTestRestaurant("applebees grill bar lubbock", RestaurantType.FamilyStyle, "American Bar and grill", 11, "11-12", "025 S Loop 289, Lubbock, TX 79423", @"https://s3-media2.fl.yelpcdn.com/bphoto/MMidaq5xH86SPi-dJWhWfw/o.jpg\", true, @"https://www.applebees.com/en", "+18067854025", false, "{\"businesses\": [{\"id\": \"4w0gvAjfFJbjP1_GX7jWxA\", \"alias\": \"applebees-grill-bar-lubbock\", \"name\": \"Applebee's Grill + Bar\", \"image_url\": \"https://s3-media2.fl.yelpcdn.com/bphoto/MMidaq5xH86SPi-dJWhWfw/o.jpg\", \"is_closed\": false, \"url\": \"https://www.yelp.com/biz/applebees-grill-bar-lubbock?adjust_creative=dkkmRxsUIEmWGpLseCr51g&utm_campaign=yelp_api_v3&utm_medium=api_v3_phone_search&utm_source=dkkmRxsUIEmWGpLseCr51g\", \"review_count\": 55, \"categories\": [{\"alias\": \"tradamerican\", \"title\": \"American (Traditional)\"}, {\"alias\": \"sportsbars\", \"title\": \"Sports Bars\"}, {\"alias\": \"burgers\", \"title\": \"Burgers\"}], \"rating\": 2.0, \"coordinates\": {\"latitude\": 33.528844, \"longitude\": -101.901284}, \"transactions\": [\"delivery\"], \"price\": \"$$\", \"location\": {\"address1\": \"4025 South Loop 289\", \"address2\": \"\", \"address3\": \"\", \"city\": \"Lubbock\", \"zip_code\": \"79423\", \"country\": \"US\", \"state\": \"TX\", \"display_address\": [\"4025 South Loop 289\", \"Lubbock, TX 79423\"]}, \"phone\": \"+18067854025\", \"display_phone\": \"(806) 785-4025\"}], \"total\": 1}"); _restaurantRepo.Add(generic1); _restaurantRepo.Add(generic2); _restaurantRepo.Add(real); }
public List <Restaurant> AllRestaurants() { return(_restaurantRepo.GetAll().ToList()); }
public IEnumerable <Restaurant> GetAll() { var Restaurants = _restaurantRepo.GetAll(); return(Restaurants); }
public async Task <ActionResult <IEnumerable <Restaurant> > > GetRestaurants() { var restos = await restaurantRepo.GetAll(); return(Ok(restos)); }
public IEnumerable <Restaurant> GetAll() { return(_restaurantContext.GetAll()); }