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
  • 4,103
  • 5
  • 27
  • 37
vishal
  • 596
  • 2
  • 12
  • 31

0 Answers0