Can I use deserialize to generate objects from xmls which are not generated by serialization?
Say, if I have a xml file like this
<Person>
<Cop name ="n1" />
<Cop name ="n2" />
</Person>
Can I deserialize it as an Object person with an IEnumberable? or do i need to serialize Object Person with an IEnumerable property then the deserialization?
Of course you can deserialize XML that has not been generated by serialization, you just have to make sure you generate or write the correct class structure with fitting attributes to match the XML structure. And I am not sure an
IEnumerableis possible but it is possible to use anList<T>orT[]. The following is a sample with aList<T>:That outputs