I have the following class:
[XmlElement("email-address")]
public class EmailAddress
{
public string address { get; set; }
public string location { get; set; }
}
The XmlElement attribute is in valid here, but I do want this behavior - is this possible? TO have the name of this class serialized in XML as email-address instead of EmailAddress?
I think you're looking for the XmlTypeAttribute if you want to change how a class is serialized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With