I’ve an ASP.NET webservice which has this class
public class Contact
{
public int type;
public string data;
}
the problem is that sometimes the “type” variable has no data, so by default it will be considered 0 and will return 0 in the XML as shown:
<Contact>
<type>0</type>
<data>Hello</data>
</Contact>
how can i avoid returning the “type” variable when it’s 0 so that i can get the following output:
<Contact>
<data>Hello</data>
</Contact>
Note: if a changed the type to be a string then the problem is solved, but i have other classes and i have to set the type of their variables. so this solution is not going to work.
any idea?
thanks
after searching and as @AVD pointed in the comment it’s not possible.