0

Json который получаю

{"ts":"7","updates":[{"type":"message_new","object":{"id":6,"date":1526936271,"out":0,"user_id":15075215111,"read_state":0,"title":"","body":"1"},"group_id":166732605}]}

Есть классы:

public class Rootobject
{
    public string ts { get; set; }
    public Update[] updates { get; set; }
}

public class Update
{
    public string type { get; set; }
    public Object _object { get; set; }
    public int group_id { get; set; }
}

public class Object
{
    public int id { get; set; }
    public int date { get; set; }
    public int _out { get; set; }
    public int user_id { get; set; }
    public int read_state { get; set; }
    public string title { get; set; }
    public string body { get; set; }
}

Парсим json через var myObject = JsonConvert.DeserializeObject<Rootobject>(data); Но мне удается достать только ts из Rootobject хотя мне помимо этого нужно еще user_id и body из Object

10

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Посмотрите другие вопросы с метками или задайте свой вопрос.