示例#1
0
        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);
        }
示例#2
0
 private bool NoAddressSuggestions(AutoCompleteResponse suggestions)
 {
     return(suggestions == null || suggestions.suggestions == null || suggestions.suggestions.Count == 0);
 }