I have a collection that I want to serialize to an xml document. The class is:
public class Contacts{
public List<PendingContactDTO> contacts { get; set; }
}
My main problem is that now my xml looks
<Contacts>
<contacts>
<..... all contacts>
</contacts>
</Contacts>
The thing is, I want to look it like this:
<contacts>
<..... all contacts>
</contacts>
Is there a way to this?
should give you:
(the
XmlRootAttributerenames theContactstocontacts; theXmlElementAttributetells it to remove the extra layer for the collection node, naming eachcontact)