public async Task <IActionResult> Get() { var entity = await _client.SearchAsync(); var result = _mapper.Map <List <Gourmet> >(entity); if (result == null || result.Count == 0) { return(NotFound()); } return(Ok(result)); }
public async Task <IActionResult> Get(string keyword) { var geocode = await GeocodeClient.GetGeocodeAsync(HttpUtility.UrlDecode(keyword)); var entity = await GourmetClient.SearchAsync(geocode.results[0].geometry.location.lng, geocode.results[0].geometry.location.lat); var result = _mapper.Map <List <Gourmet> >(entity); if (result == null || result.Count == 0) { return(NotFound()); } return(Ok(result)); }