简体   繁体   English

protobuf-net — DataContractSurrogates?

[英]protobuf-net — DataContractSurrogates?

Right now, I'm using DataContractSerializer along with DataContractSurrogate to provide serialization descriptions for NHibernate proxy classes (as described in http://timvasil.com/blog14/post/2008/02/WCF-serialization-with-NHibernate.aspx ). 现在,我正在使用DataContractSerializerDataContractSurrogate来提供NHibernate代理类的序列化描述(如http://timvasil.com/blog14/post/2008/02/WCF-serialization-with-NHibernate.aspx中所述 )。

I'm really interested in switching to protobuf-net to serialize my data using protobufs, but I can't seem to find a way to consume the DataContractSurrogate 's. 我真的对切换到protobuf-net感兴趣,以便使用protobufs序列化我的数据很感兴趣,但是我似乎找不到一种使用DataContractSurrogate的方法。 Without this feature, I'm dead in the water for serializing NHibernate dynamic proxy classes that derive from my model classes. 没有此功能,我将无法序列化从模型类派生的NHibernate动态代理类。

Im not a NHibernate expert, but in v2 there are a few things designed to cater for this scenario; 我不是NHibernate专家,但是在v2中,有一些设计可以满足这种情况。 foremost there is code built in intended to recognise NH proxies and treat appropriately (in particular, not complain about unknown types). 最重要的是,内置有旨在识别NH代理并进行适当处理的代码(尤其是不要抱怨未知类型)。

I will read the linked article, though; 我将阅读链接的文章。 without more NH experience I can't be sure that the current approach is sufficient. 没有更多的NH经验,我无法确定当前的方法是否足够。 I would also be more than happy to receive any test cases I could use to prove that it meets the need. 我也很高兴收到我可以用来证明它满足需求的任何测试用例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM