深入嵌入对象的字典序列化(Serialization of Dictionary embedded deep in object)

系统教程 行业动态 更新时间:2024-06-14 17:03:54
深入嵌入对象的字典序列化(Serialization of Dictionary embedded deep in object)

我一直试图序列化一个非常大的对象。 该对象使用字典来跟踪各种数据。 我正在使用二进制格式化程序,并且希望能够轻松地序列化整个对象,而不会干扰/不得不在下面的层中更改代码。

有没有办法解决这个问题? 我不想手动序列化字典(正如我见过别人那样解决这个问题)。

解决这个问题的人得到了金盘;)

I have been trying to serialize a pretty big object. This object uses dictionaries in order to keep track of various data. I am using the binary formatter, and want to be able to easily serialize the whole object whithout interfering/having to change code in the below layers.

Is there any way fix to this? I don't want to serialize the dictionaries manually (as I've seen others do to solve this issue).

The one who solves this get the golden plate ;)

最满意答案

如Anton所述,二进制序列化程序能够序列化对象图中的所有对象,只要图中的每个对象都是可序列化的。 如果您在诊断对象图中的哪些对象不可序列化时遇到问题,可以使用sertool查找:

在此处输入图像描述

As stated by Anton, the binary serializer is capable of serializing all objects in your object graph, as long as each object in the graph is serializable. If you're having trouble diagnosing which objects in your object graph aren't serializable, you can use sertool to find this out:

enter image description here

更多推荐

本文发布于:2023-04-24 14:10:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/cc01be2919b231e280aa4f1c99815cf4.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字典   对象   序列化   Serialization   object

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!