public int CompareTo(ConditionMatchResult other) { var comparison = other.MatchType.GetPriority().CompareTo(MatchType.GetPriority()); if (comparison == 0) { var numberOfExacts = other.NumberOfExacts.CompareTo(NumberOfExacts); return(numberOfExacts == 0 ? 1 : numberOfExacts); } return(comparison); }