protobuf-net——数据合约代理?

发布于 2024-10-08 19:42:25 字数 454 浏览 0 评论 0原文

现在,我使用 DataContractSerializerDataContractSurrogate 为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尴尬癌患者 2024-10-15 19:42:25

我不是 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文