7
निम्नलिखित कोड को देखते हुए ...नेट Xml serializer वैकल्पिक विशेषताओं
[XmlType("Field")]
public class SearchField
{
[XmlAttribute("alias")]
public string Alias;
[XmlAttribute("entity")]
public string Entity;
}
उर्फ हमारे लिए एक वैकल्पिक फ़ील्ड है, लेकिन deserializer फेंकता है जब "उर्फ" विशेषता एक्सएमएल से लापता है। आप इसे वैकल्पिक कैसे बनाते हैं? क्या एक स्कीमा आवश्यक है?