public static List <Address> Map(AutoCompleteResponse repsonse, Address raw) { var addresses = repsonse.suggestions.Select(suggestion => { var rawCopy = JsonSerializer.Deserialize <Address>(JsonSerializer.Serialize(raw)); rawCopy.Street1 = suggestion.street_line; rawCopy.Street2 = suggestion.secondary; rawCopy.City = suggestion.city; rawCopy.State = suggestion.state; rawCopy.Zip = suggestion.zipcode; return(rawCopy); }).ToList(); return(addresses); }
private bool NoAddressSuggestions(AutoCompleteResponse suggestions) { return(suggestions == null || suggestions.suggestions == null || suggestions.suggestions.Count == 0); }