public async Task <DocumentTypeSearchModel> GetDocumentTypes(DocumentTypeSearchModel model) { var url = ODataApiUri + "/DocumentType?" + GetFilterStringForLookup(model); var result = await GetOdataResultFromApi(url); var searchResultCount = 0; if (result.Count != null) { int.TryParse(result.Count.ToString(), out searchResultCount); } model.TotalRows = searchResultCount; model.DocumentTypeSearchResult.Clear(); model.DocumentTypeSearchResult.AddRange(result.Items.Select(item => JsonConvert.DeserializeObject <DocumentTypeDto>(item.ToString()))); return(model); }
public async Task <DocumentTypeSearchModel> GetDocumentTypes(DocumentTypeSearchModel model) { return(await _documentTypeApiClient.GetDocumentTypes(model)); }