How to handle null in xml and c#

suppose i am trying to deserialize xml to my class and if any value is null or empty for decimal or datetime then how to handle the null.

[XmlElement(ElementName = "Salary" , typeof(double))]
public string Salary { get; set; }

[XmlElement(ElementName = "BirthDate" , typeof(DateTime))]
public string Phone { get; set; }

suppose if BirthDate or Salary is null or empty in xml then how to handle it at the time of deserialization. need solution. thanks.

5
задан TheSmurf 1 August 2013 в 21:27
поделиться