English 中文(简体)
当我不使用Reference=true?
原标题:When/Why should I not use IsReference=true on my DataContracts?

I understand what is the attribute property IsReference and what it is doing. But I don t understand why/when I should not use it. When is it a bad idea to use IsReference=true?

If my wcf service are .net to .net, is there good reasons to not set IsReference=true?

问题回答

至少有两个原因可以避免使用《规则》:

首先,由于所有序列器都必须对每一物体进行身份检查,并按序进行。

其次,数据ContractJsonSerializer不能将带有Is Reference属性的物体序列。 因此,如果你需要支持Xml和Json,你就无法使用。

除此以外,我看不到任何理由不使用。 之后,它拯救了一些宝贵的带宽!

我认为不应发生任何坏事。 如果你的图表含有与同一物体的不止一个链接,那么确定这一真实性将减少XML的规模。

但 我不敢肯定,为什么它不能因违约而获得。





相关问题
WCF DataMember Serializing questions

Ok, so I was part way through the long winded process of creating DTOs for sending my model over the wire and I don t feel like I m going down the right route. My issue is that most of the entities ...

Access WCF service on same server

I have a .NET website with a WCF service. How do I access the current operations context of my service? One possible work around is to just make a call to the service within the app...but that seems ...

WCF binding error

So I got into work early today and got the latest from source control. When I try to launch our ASP.NET application, I get this exception: "The binding at system.serviceModel/bindings/wsHttpBinding ...

The service operation requires a transaction to be flowed

I am facing strange issue with our WCF service. The same code was working fine until recently we added more OperationContracts(Web Methods). We have common 3 tier architecture. DAL (WCF) BLL Web ...

热门标签