I have a dataset named DocumentDataSet along with a class named Document.
When the dataset is serialized, I need it to have it root named "Document" because I'm communicating with a 3rd party webservice.
I though of defining the attribute XmlRoot
in the partial class of the dataset, but I cannot add a duplicate of XmlRoot since it is already defined in the designer class.
[global::System.Xml.Serialization.XmlRootAttribute("DocumentDataSet")]
public partial class DocumentDataSet : global::System.Data.DataSet { ... }
I could change it in the designer class, but it get reset every time I open the dataset in design.
Is there is a way to override XmlRoot
or make it serialize with a different name that its class name?