Which .NET JSON serializers can deal with NHibernate proxy objects?

半腔热情 提交于 2019-12-08 07:25:11

问题


Which .NET JSON serializers can deal with NHibernate proxy objects? I tried using JSON.NET but it craps out when it hits a proxied object.


回答1:


I would say that the best idea would be to deal with the proxy objects rather than actually find another way to serialise JSON. I have answered another question which involves eager loading these proxy objects in a legacy database which returns either the correct object or null here. Please also note that with the proper database set up with foreign keys and definite links between objects/tables you shouldn't run into any proxy objects. Also note that this is not what is required for fluent NHibernate, I am assuming that you are using separate hbm mapping files.

Good luck!



来源:https://stackoverflow.com/questions/1918483/which-net-json-serializers-can-deal-with-nhibernate-proxy-objects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!