I'm using Web API and I've set the below property so that the default value is not displayed when members are serialized:
[DataMember(EmitDefaultValue = false)]
public string EventName { get; set; }
I have in total about 20 DataContracts and 100 properties as DataMembers so how would that be possible to set the EmitDefaultValue to false globally for all?
I hope I don't have to write my own logic using Reflection!
In your App_Start folder add this to WebApiConfig