How do I (de)serialize the following xml element:
<OtherInfo name=\"Some Name\" type=\"text\">Hello World!!!\n</OtherInfo>
I define the following class to take care of the attributes:
[Serializable]
public class OtherInfo
{
[XmlAttribute(AttributeName = "name")]
public string Name { get; set; }
[XmlAttribute(AttributeName = "type")]
public string Type { get; set; }
public OtherInfo() { }
public OtherInfo(string name, string type) => (Name, Type) = (name, type);
}
But how do I handle the property value?