예제 #1
0
        public async Task <ListDistrictDTO> GetDistrictByLocation(string keyword, int?LocationId)
        {
            var result = await _repoWrapper.Location.GetDistrictByLocation(keyword, LocationId);

            var output = new ListDistrictDTO();

            output.Data = _mapper.Map <IEnumerable <DistrictDTO> >(result);
            return(output);
        }
예제 #2
0
        public async Task <ListDistrictDTO> GetDistrictByLocation(int?locationId, string text)
        {
            ListDistrictDTO output       = new ListDistrictDTO();
            string          apiUrl       = $"/api/v1/Location/GetDistrictByLocation";
            string          paramRequest = $"?LocationId={locationId}&keyword={text}";
            var             response     = await _client.GetAsync(apiUrl + paramRequest);

            if (response.IsSuccessStatusCode)
            {
                string responseStream = await response.Content.ReadAsStringAsync();

                output = JsonConvert.DeserializeObject <ListDistrictDTO>(responseStream);
            }
            return(output);
        }