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?
There are at least two reasons to avoid using IsReference:
First there is a performance penalty since all the serializer must perform an identity check for each object that is to be serialized.
Second, the DataContractJsonSerializer cannot serialize objects marked with the IsReference attribute. So if you need to support both Xml and Json then you cannot use it.
Apart from those, I don't see any reason not to use it. After all it does save some precious bandwidth!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With