This will work
public class PleaseIgnoreMe
{
[XmlIgnore]
public string A { get; set; }
[XmlIgnore]
public string B { get; set; }
}
However, when I apply this
using System.Xml.Serialization;
[XmlIgnore]
public class PleaseIgnoreMe
{
public string A { get; set; }
public string B { get; set; }
}
the following error shows up.
Error 265 Attribute 'XmlIgnore' is not valid on this declaration type. It is only valid on 'property, indexer, field, param, return' declarations.
What is the equivalent [XmlIgnore] for a class ? I need all of its properties to be ignored without specifying it one by one.