I would like to know how to ignore a specific item/index of a List
from being serialized using XmlSerializer
.
For example, co
Better solution is to create a new collection with LINQ query and pass to serializer, like
List collection = new List(){ 0, 1, 2, 3 };
using (var fs = new StreamWriter("serialized.txt"))
{
XmlSerializer serializer = new XmlSerializer(collection.GetType());
serializer.Serialize(fs, collection.Where(x => x != 0).ToList());
}