Given the correct "MagicName" (it was something like "CanSerialize"), the following code will suppress xml for empty lists.
What is this magic name?
public class MyClass { public List<int> MyList{ get; set; } public bool MyListMagicName() { return MyList.Count != 0; } public MyClass() { MyList = new List<int>(); } }
Forgetful
source share