Hi guys,
I have an xml file, something like this:
<root>
<groups>
<group />
<group />
</groups>
</root>
Now, I want to make a class something like this:
[XmlRoot]
public class Root
{
[XmlElement("groups")]
public Groups Groups { get; set; }
}
The problem is that the XmlElement attribute will make all the collection items named "groups" and I end up with something like this instead:
<root>
<groups />
<groups />
</root>
And if I leave the XmlElement attribute off, it will actually print the file with the correcy nodes, but the name of the node has captialized:
<root>
<Groups>
<group />
<group />
</Groups>
</root>
This is very annoying. How can I tell it to make the name in lowercase (or whatever name I want) for the xml file but to have it as Pascal case in my source code whilst at the same time specifying what the names of the sub elements should be?
Thanks