In order to do a XML Serialization, I implemented this structure
[XmlRoot("NXRoutes")]
public class NXRoutes
{
[XmlElement("NXRoute")]
public List<NXRoute> NXRoute { get; set; }
}
public class NXRoute
{
[XmlAttribute("ID")]
public string ID { get; set; }
[XmlElement("Path")]
public List<Path> Path { get; set; }
}
public class Path
{
[XmlAttribute("Nbr_R")]
public int R_count { get; set; }
[XmlAttribute("ID")]
[XmlAttribute("Preferred")]
public string Preferred { get; set; }
}
in each element of my list NXRoute
i would like to make comparison between the elements of the list Path
and this comparison is based on the value of the integer attribute R_Count
==> For example for the path that has the smallest value in its attribute "R_Count" I would do a calculation / and for others I would do another calculation
how can i implement this comparison to do some calculation on the path element ?
example of calculation (for more details): after comparaison :
- for the path with the smallest attribute
R_Count
i will puth it's attributePreferred="YES"
- For the other paths put their attribute
Preferred="NO"