protobuf-net——数据合约代理?
现在,我使用 DataContractSerializer
和 DataContractSurrogate
为 NHibernate 代理类提供序列化描述(如 http://timvasil.com/blog14/post/2008/02/WCF-serialization-with-NHibernate.aspx< /a>)。
我真的很想切换到 protobuf-net 来使用 protobuf 序列化我的数据,但我似乎找不到使用 DataContractSurrogate 的方法。如果没有这个功能,我在序列化从我的模型类派生的 NHibernate 动态代理类时就会陷入困境。
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).
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. Without this feature, I'm dead in the water for serializing NHibernate dynamic proxy classes that derive from my model classes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不是 NHibernate 专家,但在 v2 中,有一些东西旨在满足这种情况;最重要的是,内置了旨在识别 NH 代理并进行适当处理的代码(特别是不抱怨未知类型)。
不过,我会阅读链接的文章;如果没有更多的 NH 经验,我无法确定当前的方法是否足够。我也非常乐意收到任何可以用来证明它满足需求的测试用例。
Im not a NHibernate expert, but in v2 there are a few things designed to cater for this scenario; foremost there is code built in intended to recognise NH proxies and treat appropriately (in particular, not complain about unknown types).
I will read the linked article, though; without more NH experience I can't be sure that the current approach is sufficient. I would also be more than happy to receive any test cases I could use to prove that it meets the need.