Json attributes Array ArrayItem

~Edge

New Member
Is there an equivalent in json for the XML attributes\[code\][XmlArray("images")][XmlArrayItem("image", Type = typeof(Image))]public List<Image> images { get; set; }\[/code\]The json/xml string has nested arrays that's why i need this attributes for xml.This is working in xml but i like to change this to json deserialization.JsonString (shortened): ..."{"search_articles":{"articles":{"@attributes":{"hits":10134},"article":[{"id":1505256, ... ,"images":{"image":[{"type":"article","type_id":1630893...Code for desdeserialization:\[code\]var json = response.Content.ReadAsStringAsync().Result;JObject rss = JObject.Parse(json);JArray articlesArray = (JArray)rss["search_articles"]["articles"]["article"];var articles = JsonConvert.DeserializeObject<List<Article>>(articlesArray.ToString());\[/code\]deserialization fails because the images array could not be deserialized.
 
Back
Top