I need to export a collection of items in camel casing, for this I use a wrapper.
The class itself:
[XmlRoot("example")]
public class Example
{
[XmlElement("exampleText")]
public string ExampleText { get; set; }
}
This serializes fine:
<example>
<exampleText>Some text</exampleText>
</example>
The wrapper:
[XmlRoot("examples")]
public class ExampleWrapper : ICollection<Example>
{
[XmlElement("example")]
public List<Example> innerList;
//Implementation of ICollection using innerList
}
This however capitalizes the wrapped Example
s for some reason, I tried to override it with XmlElement
but this doesn't seem to have the desired effect:
<examples>
<Example>
<exampleText>Some text</exampleText>
</Example>
<Example>
<exampleText>Another text</exampleText>
</Example>
</examples>
Who can tell me what I am doing wrong or if there is an easier way?