Login
Резюме для программиста
89957 просмотров
Перейти к просмотру всей ветки
in Antwort alex445 07.12.21 17:53
По вашей ссылке такая
-----
Вообще-то - такая:
// Root myDeserializedClass = JsonConvert.DeserializeObject(myJsonResponse); public class Item { [JsonConstructor] public Item( [JsonProperty("prop1")] string prop1, [JsonProperty("prop2")] string prop2, [JsonProperty("description")] string description ) { this.Prop1 = prop1; this.Prop2 = prop2; this.Description = description; } [JsonProperty("prop1")] public string Prop1 { get; } [JsonProperty("prop2")] public string Prop2 { get; } [JsonProperty("description")] public string Description { get; } } public class Root { [JsonConstructor] public Root( [JsonProperty("items")] List items ) { this.Items = items; } [JsonProperty("items")] public IReadOnlyList Items { get; } }