// // Summary: // list a restaurant by keyword with basic cache memory // // Returns: // list of restaurant // // Params: // keyword: keyword from UI e.g. Bang Sue // public async Task <IEnumerable <Restaurant> > ListAsync(string keyword) { var places = await _googleService.ListPlaceByTextSeachAsync(keyword, PlaceType.RESTAURANT.GetDescription()); if (!places.Any()) { throw new RestaurantNotFoundException(); } //mapping from apis model to restaurant entity var entities = _autoMapper.Map <List <Restaurant> >(places); return(entities); }
public async Task <IActionResult> ListPlaceByTextSeachAsync(string keyword, string type) { var entities = await _googleService.ListPlaceByTextSeachAsync(keyword, type); return(Ok(entities)); }