I have create Wcf service point that returns json. And my question is how to return empty string in json instead null.
{
"Avatar": null // send only -> ""
"Email": null,
"FirstName": "John",
"ID": 1,
"LastName": "Travolta",
"NickName": null,
"Password": null
}
-------EDIT---------
[DataMember]
public int ID { get; set; }
[DataMember]
public string FirstName { get; set; }
[DataMember]
public string LastName { get; set; }
[DataMember]
public string NickName { get; set; }
[DataMember]
public string Email { get { return string.IsNullOrEmpty(_email) ? "" : _email; } set { _email = value; } }
private string _email;
[DataMember]
public string Password { get; set; }
[DataMember]
public string Avatar { get; set; }