I need to deserialize some xml to c# objects. This is my class:
[XmlRoot("root")]
[Serializable]
public class MyRoot
{
[XmlElement("category")]
public List<Category> Categories { get; set; }
}
I'm deserializing like this:
root = (MyRoot)new XmlSerializer(typeof(MyRoot)).Deserialize(new StringReader(client.DownloadString(XmlUrl)));
But I want to ignore some Category elements with specified "id" attribute values. Is there some way I can do this?