I'm trying to deserialize an object in xml which is deeply nested.
Here's the xml code:
<modules>
<channel>
<resources>
<resource name="x" refresh_interval="180">... text ...</resource>
<resource name="y" refresh_interval="180">..text..</resource>
<resource name="z" refresh_interval="180">... text ...</resource>
</resources>
</channel>
</modules>
I have a lot more elements like channel in the modules node, but for the example this one is enough I hope. Then I have my class:
public class IdentifyData{
public Modules modules;
}
public class Modules
{
public List<Resources> channels;
}
public class Resources
{
[DataMember(Name = "name")]
public string name { get; set; }
[DataMember(Name ="url")]
public string url { get; set; }
[DataMember(Name = "refresh_interval")]
public string refresh_interval { get; set; }
}
I tried with XmlArray and everything and it just doesn't want to work, and of course I searched all over stack overflow and I couldn't find the right answer.