我返回的XML输出到浏览器与WCF web服务,如果DataContract的属性为空,但仍来自通过在响应为
I am returning the xml output to the browser with a wcf webservice, if a property of a DataContract is null, it still comes through in the response as
<Id i:nil="true" />
有没有办法把它在所有的响应不归?
Is there a way to have it not return in the response at all?
想通了我自己,我需要以下atrribute添加到我的数据成员
Figured it out myself, I needed to add the following atrribute to my DataMembers
[DataMember(EmitDefaultValue = false)]