internal static CrosslinksVm MapToCrosslinksVm(this NearbySearchResult searchResult, ISearchCriteria sourceCriteria) { CrosslinksVm crosslinksVm = new CrosslinksVm(); foreach (SearchCriteria nearbyCity in searchResult.NearbyCities) { if (!nearbyCity.MapToSearchCriteriaVm().Validate()) { continue; } LinkVm linkVm = new LinkVm() { InnerText = ClientViewModelsProvider.GetLookupLocation(nearbyCity), Href = MslcUrlBuilder.SearchUrl(nearbyCity, sourceCriteria.SearchType()) }; crosslinksVm.Cities.Add(linkVm); } foreach (ListingType availableListingType in searchResult.AvailableListingTypes) { LinkVm linkVm1 = new LinkVm() { InnerText = availableListingType.GetEnumLocalizedValue <ListingType>(), Href = MslcUrlBuilder.SearchUrl(sourceCriteria, availableListingType.ToSearchType()) }; crosslinksVm.Categories.Add(linkVm1); } if (searchResult.IsServiceProvidersAvailable) { LinkVm linkVm2 = new LinkVm() { InnerText = "Products & Services", Href = MslcUrlBuilder.SearchUrl(sourceCriteria, SearchType.ProductsAndServices) }; crosslinksVm.Categories.Add(linkVm2); } return(crosslinksVm); }