0

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
}
Eliahu Aaron
  • 1
  • 4
  • 26
  • 35
vishal
  • 596
  • 1
  • 10
  • 27

0 Answers0