WCF DataContractJsonSerializer - Exclude specific properties at runtime
I am serializing a .net 4 object using DataContractJsonSerializer. How can I include/exclude specific properties from serialization based on information only 开发者_C百科available at runtime ? Can the IDataContractSurrogate be used for this ? If so....I need a good sample. I primarily want to exclude properties. I do NOT want to substitute nulls....however I want to exclude specific properties entirely at runtime. I want to do at runtime which is the equivalent of removing DataMember attribute at pre-runtime.
Thanks
He asked the same question and got a very good response at the following link:
http://social.msdn.microsoft.com/Forums/en/wcf/thread/dd520d9b-334f-4e78-9b08-bf809b887e4f
精彩评论