Serialize an array of objects as Xxxxs rather than ArrayOfXxxx
- by Richard
I'm using ASP.NET MVC with XmlResult from MVCContrib.
I have an array of Xxxx objects, which I pass into XmlResult.
This gets serialized as:
<ArrayOfXxxx>
<Xxxx />
<Xxxx />
<ArrayOfXxxx>
I would like this to look like:
<Xxxxs>
<Xxxx />
<Xxxx />
<Xxxxs>
Is there a way to specify how a class gets serialized when it is part of array?
I'm already using XmlType to change the display name, is there something similar that lets you set its group name when in an array.
[XmlType(TypeName="Xxxx")]
public class SomeClass
Or, will I need to add a wrapper class for this collection?