I have a list of objects I need to sort by a property.
If the 2 values are the same I then resort by a second property and so on.
This is reasonable simple but I have run into an issue regarding "0" needing to be treated as the highest value as this is just a default.
The sorting I am doing at this stage is
if (sortType == "win odds")
runners.Sort(delegate(RunnerDetail r1, RunnerDetail r2)
int xdiff1 = ConvertFromString((String)r1.winTable["NZL"]).CompareTo((ConvertFromString((String)r2.winTable["NZL"])));
if (xdiff1 != 0)
int xdiff2 = ConvertFromString((String)r1.placeTable["NZL"]).CompareTo((ConvertFromString((String)r2.placeTable["NZL"])));
if (xdiff2 != 0)
I cannot hack the values to a high number for the sort.
Also just copying the values into 2 lists and adding the "0" ones to the end does not work as one of the secondary values may also be "0" etc.
Can anyone help?