Как преобразовать мягкую ссылку типа C# json newton в Google.Maps.AddressValidation.V1.AddressComponentC#

Место общения программистов C#
Anonymous
Как преобразовать мягкую ссылку типа C# json newton в Google.Maps.AddressValidation.V1.AddressComponent

Сообщение Anonymous »

Код: Выделить всё

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

Вернуться в «C#»