J'ai donc un xml qui a une structure similaire à celle-ci:C# désérialisation partielle
<MyObject>
<PropertyA>Value</PropertyA>
<PropertyB>Value</PropertyB>
<PropertyC>Value</PropertyC>
<ArrayOfOtherObject>
<OtherObject>
<PropertyX>Value</PropertyX>
<PropertyY>Value</PropertyY>
<PropertyZ>Value</PropertyZ>
</OtherObject>
<OtherObject>
<PropertyX>Value</PropertyX>
<PropertyY>Value</PropertyY>
<PropertyZ>Value</PropertyZ>
</OtherObject>
<OtherObject>
<PropertyX>Value</PropertyX>
<PropertyY>Value</PropertyY>
<PropertyZ>Value</PropertyZ>
</OtherObject>
</ArrayOfOtherObject>
</MyObject>
Est-il possible que je puisse désérialiser MyObject mais pas le ArrayOfOtherObject? Et puis plus tard faire une charge paresseuse de ArrayOfOtherObject en cas de besoin?
J'utilise généralement XmlDeserialization, mais je sais que ça charge toujours le tout.
Merci!
Pour être honnête, à moins que le volume de données est énorme, vous seriez mieux d'aller pour l'approche la plus simple et deserialize tout. –
+1 bonne question Carlo – toddmo