How do i set the properties of "result" to nullable int. The code below doesnt work
<Package><Document><ID>0</ID><UID/><SequenceNumber>0</SequenceNumber></Document><Document><ID/><UID/><SequenceNumber>1</SequenceNumber></Document><Document><ID>2</ID><UID/><SequenceNumber/></Document></Package>
static void Main(string[] args) { var result = XDocument.Parse(GetXml()).Root.Elements() .Select(x => new {
//this doesnt work ID = (int?)(x.Element("ID")), UID = (int?)(x.Element("UID")), SequenceNumber = (int?)(x.Element("SequenceNumber")), }).ToList(); }