Код: Выделить всё
I am receiving an object as a result to a query to Google Maps API Validation Service.
Then I try to convert to Google Address Component type.
But I am getting an empty var when converting it:
object result = new WebClient().DownloadString(url);
string json = result.ToString();
var obj = JObject.Parse(json);
Google.Maps.AddressValidation.V1.AddressComponent ob. =
obj.ToObject();
or if I dont convert it an error when passing it to the function: cannot convert from
'Newtonsoft.Json.Linq.JToken' to
System.Collections.Generic.List'"
This is a snippet of the function that will receive the google maps address and extract it in separate fields :
public Dictionary GetAddressObject(List addressComponents)
Google.Maps.AddressValidation.V1.AddressComponent
Подробнее здесь: https://stackoverflow.com/questions/784 ... ssvalidati