如果任何域对象,而不是可序列化的? [英] Should any domain object, not be serializable?
本文介绍了如果任何域对象,而不是可序列化的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法,只是告诉编译器,我想我的对象是序列化的默认?
Is there a way to just tell the compiler, that I want my objects to be serializable by default?
推荐答案
pretty的每得多序列化引擎会想知道你的对象是合适的。这可以采取以下形式:
Pretty much every serialization engine is going to want to know that your objects are suitable. This can take the form of:
-
[Serializable接口]
/ISerializable的
(BinaryFormatter的 <$ C C $>,SoapFormatter
) -
[Serializable接口]
/的IXmlSerializable
(和公开
)(的XmlSerializer
) -
[DataContract]
/[MessageContract]
(或最上面)(DataContractSerializer的
及变种)
[Serializable]
/ISerializable
(BinaryFormatter
,SoapFormatter
)[Serializable]
/IXmlSerializable
(andpublic
) (XmlSerializer
)[DataContract]
/[MessageContract]
(or most of the above) (DataContractSerializer
and variants)
AFAIK,没有办法避免这种步骤的
AFAIK, there is no way of avoiding this step.
这篇关于如果任何域对象,而不是可序列化的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文