public async Task <ListManufactureSearchDTO> Search(int productCategoryId, int?productTypeId, string search = "") { var result = await _repoWrapper.Manufacture.SearchManufacture(productCategoryId, productTypeId, search); var output = new ListManufactureSearchDTO(); output.Data = _mapper.Map <IEnumerable <ProductManufacture_SearchByCategory_Result_DTO> >(result); return(output); }
public async Task <ListManufactureSearchDTO> SearchManufactures(int productCategoryId, int?productTypeId, string search = "") { ListManufactureSearchDTO output = new ListManufactureSearchDTO(); string apiUrl = $"/api/v1/Manufacture/Search"; string paramRequest = $"?productCategoryId={productCategoryId}&productTypeId={productTypeId}&search={search}"; var response = await _client.GetAsync(apiUrl + paramRequest); if (response.IsSuccessStatusCode) { string responseStream = await response.Content.ReadAsStringAsync(); output = JsonConvert.DeserializeObject <ListManufactureSearchDTO>(responseStream); } return(output); }