I have an xml as below
<Image Id="23" Name ="image1">
<Used_in Name ="Label1" />
</Image>
Here Image node has been serialized as an object of Image class
[XmlElement(ElementName = "Image")]
public class Image
{
[XmlAttribute]
public string Name
{
getter and setter
}
[XmlAttribute]
public string ID
{
getter and setter
}
}
While deserializing ,but while saving this xml an extra node is also added as child node to it
<Used_in Name ="Label1" />
which indicates where all it is used.Is there a way to ignore child nodes while doing XML deserialize???