所以我有一个具有类似的结构,以这一个xml:C#部分反序列化
<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>
有没有我可以反序列化的MyObject但不是ArrayOfOtherObject的方法吗?然后稍后在需要时对ArrayOfOtherObject执行延迟加载?
我通常使用XmlDeserialization,但AFAIK它总是加载整个事情。
谢谢!
说实话,除非数据量是巨大的,你会过得更好去为最简单的方法,和反序列化这一切。 – 2009-10-15 15:39:53
+1好问题Carlo – toddmo 2013-12-09 16:33:06