I need to export a collection of objects to the camel shell, for this I use a wrapper.
The class itself:
[XmlRoot("example")] public class Example { [XmlElement("exampleText")] public string ExampleText { get; set; } }
This serializes perfectly:
<example> <exampleText>Some text</exampleText> </example>
Wrapper:
[XmlRoot("examples")] public class ExampleWrapper : ICollection<Example> { [XmlElement("example")] public List<Example> innerList;
This, however, capitalizes the wrapped Example for some reason, I tried to override it with an XmlElement , but this does not 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'm doing wrong, or if there is an easier way?
source share