0
Answer

deserialization issue

Ask a question
George George

George George

15y
2.2k
1

Hello everyone,

1.

Here is one of the field of my class. During deserialization, if the counter attribute is null, the deserialization could still be successful. Any ideas to make deserialization be smarter to treat counter as a non-null (must to have value) attribute?

2.

Any other ways to make deserialization be even smarter to treat counter as an integer other than string? (i.e. if in the XML file, counter attribute is assigned to non-numeric value, deserialization will fail.)


[Code]
        [XmlAttribute("counter")]
        public string counter;
[/Code]

thanks in advance,
George