I have Json.Net library which can be download here http://json.codeplex.com/. Very robust library. I highly recommend using it when dealing with Json string.
Anyway, back to the issue, to solve this problem, we create a method on the class itself with the following prefix "ShouldSerialize" + "
public bool ShouldSerializeMyString()
{
return !string.IsNullOrEmpty(MyString);
}
References:
http://james.newtonking.com/
No comments:
Post a Comment