How to avoid having duplicate objects in WCF over protobuf

前端 未结 1 1218
南方客
南方客 2021-01-18 06:17

I\'ve a small units tests to test circular dependencies.

My object is the following:

[ProtoContract]
public class Node
{
    [ProtoMember(1)]
    pub         


        
相关标签:
1条回答
  • 2021-01-18 07:03

    To me it looks as if the question is similar to this question where we realized a problem with the root level entity.

    What we had as well is that for child object the reference where correct but the if the root item was referenced again a copy was there after deserialization.

    Our work-around that we used for some time (and then we switched to pure JSON) was to add an extra root node. With this extra root node references where deseriliazed correctly. So this might be a work-around you could try as well.

    0 讨论(0)
提交回复
热议问题