public async Task <ListLocationDTO> GetLocationByCountry(string keyword, int CountryId = 7) { var result = await _repoWrapper.Location.GetAllLocation(keyword); var output = new ListLocationDTO(); output.Data = _mapper.Map <IEnumerable <LocationDTO> >(result); return(output); }
public async Task <ListLocationDTO> GetAllLocation() { var output = new ListLocationDTO(); string apiUrl = $"/api/v1/Location/GetAllLocation"; var response = await _client.GetAsync(apiUrl); if (response.IsSuccessStatusCode) { string responseStream = await response.Content.ReadAsStringAsync(); output = JsonConvert.DeserializeObject <ListLocationDTO>(responseStream); } return(output); }
public async Task <ListLocationDTO> GetLocationByCountry(int?countryId, string text) { ListLocationDTO output = new ListLocationDTO(); string apiUrl = $"/api/v1/Location/GetLocationByCountry"; string paramRequest = $"?CountryId={countryId}&keyword={text}"; var response = await _client.GetAsync(apiUrl + paramRequest); if (response.IsSuccessStatusCode) { string responseStream = await response.Content.ReadAsStringAsync(); output = JsonConvert.DeserializeObject <ListLocationDTO>(responseStream); } return(output); }