I need to map this XML into a C # class to deserialize via RestSharp Deserialization :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rsp stat="ok">
<items total="1232177" items="100">
<media id="4779808" thumb="http://mh-2-rest.panthermedia.net/media/previews/0004000000/04779000/04779808_thumb_170.jpg"/>
<media id="8950240" thumb="http://mh-2-rest.panthermedia.net/media/previews/0008000000/08950000/08950240_thumb_170.jpg"/>
<media id="12842738" thumb="http://mh-1-rest.panthermedia.net/media/previews/0012000000/12842000/12842738_thumb_170.jpg"/>
</items>
</rsp>
The class I mapped looks like this:
namespace PantherMediaAPI
{
public class Media
{
public string Id { get; set; }
public string Thumb { get; set; }
}
public class Items
{
public List<Media> Media { get; set; }
public string Total { get; set; }
public string _items { get; set; }
public Items()
{
this.Media = new List<PantherMediaAPI.Media>();
}
}
public class Rsp
{
public Items Items { get; set; }
public string Stat { get; set; }
}
}
But when I get the answer all attributes are populated minus the item public List<Media> Media { get; set; }
:
What am I missing? I have a lot of difficulty with XML because I work more with JSON.