namespace ParseJson
{
public class GlobalType
{
[JsonProperty("Q")]
public string ClassType { get; set; }
[JsonProperty("D")]
public Dictionary<string, List<Houses>> HouseModel { get; set; }
public Dictionary<string, List<Users>> UserModel { get; set; }
public override string ToString()
{
return string.Format(ClassType);
}
}
public class Houses
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("address")]
public string Address { get; set; }
[JsonProperty("type")]
public int Type { get; set; }
[JsonProperty("flors")]
public int Flors { get; set; }
}
public class Users
{
[JsonProperty("name")]
public string name { get; set; }
[JsonProperty("login")]
public string login { get; set; }
[JsonProperty("group")]
public int group { get; set; }
[JsonProperty("phones")]
public List<Phones> phone { get; set; }
}
public class Phones
{
[JsonProperty("id")]
public string id { get; set; }
[JsonProperty("value")]
public string value { get; set; }
}
}
{
"Q": "HOUSES",
"D":
{
"items":
[
{
"name": "Дом Ивана",
"address": "г. Казань, Кремлевская 1",
"type": 1,
"flors": 2
},
{
"name": "Дом Ирины",
"address": "г. Казань, Кремлевская 2",
"type": 2,
"flors": 1
},
{
"name": "Вотчина Деда мороза",
"address": "Россия, Великий устюг, Дедо морозовская 1",
"type": 3,
"flors": 2
}
]
}
}
{
"Q": "USERS",
"D":
{
"items":
[
{
"name": "Иван",
"login": "Ivan",
"group": 1,
"phones": [
{
"id": 1,
"value": "+791234567890"
},
{
"id": 2,
"value": "+7843952000000"
}
]
},
{
"name": "Ирина",
"login": "Irina",
"group": 2,
"phones": []
},
{
"name": "Дед Мороз",
"login": "dead_moroz",
"group": 1,
"phones": [
{
"id": 1,
"value": "+71234567890"
}
]
}
]
}
}