internal static SearchResult <MultiSearch> CreateMultiSearch(SearchResultDTO searchResult) { if (searchResult == null) { return(null); } searchResult.Results = searchResult.Results ?? Array.Empty <SearchResultItemDTO>(); var results = SearchResultItemFactory.Create(searchResult.Results); return(new SearchResult <MultiSearch>(results, searchResult.Page, searchResult.TotalResults, searchResult.TotalPages)); }
internal static SearchResult <IList <T> > CreateList <T>(SearchResultDTO searchResult) { if (searchResult == null) { return(null); } searchResult.Results = searchResult.Results ?? Array.Empty <SearchResultItemDTO>(); var results = new List <T>(); foreach (var serachResultItem in searchResult.Results) { results.Add(SearchResultItemFactory.Create <T>(serachResultItem)); } return(new SearchResult <IList <T> >(results, searchResult.Page, searchResult.TotalResults, searchResult.TotalPages)); }