I am using SharpSerializer to serialize my objects to XML. By default all public properties are serialized.
Is it possible to exclude null-values from serialization?
For example:
public class Test
{
public int Id {get;set;}
public string Text {get;set;}
}
private void Main(string[] args)
{
Test t = new Test();
t.Id = 1; //Serialize this
t.Text = null; //Don't serialize this
//Do Serialization
}