public int CompareTo(ExportByTerritory other) { if (ReferenceEquals(this, other)) { return(0); } if (ReferenceEquals(null, other)) { return(1); } var countryComparison = string.Compare(Country, other.Country, StringComparison.OrdinalIgnoreCase); if (countryComparison != 0) { return(countryComparison); } var monthOldComparison = MonthOld.CompareTo(other.MonthOld); if (monthOldComparison != 0) { return(monthOldComparison); } var monthUsdOldComparison = MonthUsdOld.CompareTo(other.MonthUsdOld); if (monthUsdOldComparison != 0) { return(monthUsdOldComparison); } var monthCountOldComparison = MonthCountOld.CompareTo(other.MonthCountOld); if (monthCountOldComparison != 0) { return(monthCountOldComparison); } var yearOldComparison = YearOld.CompareTo(other.YearOld); if (yearOldComparison != 0) { return(yearOldComparison); } var yearUsdOldComparison = YearUsdOld.CompareTo(other.YearUsdOld); if (yearUsdOldComparison != 0) { return(yearUsdOldComparison); } var yearCountOldComparison = YearCountOld.CompareTo(other.YearCountOld); if (yearCountOldComparison != 0) { return(yearCountOldComparison); } var monthTodayComparison = MonthToday.CompareTo(other.MonthToday); if (monthTodayComparison != 0) { return(monthTodayComparison); } var monthUsdTodayComparison = MonthUsdToday.CompareTo(other.MonthUsdToday); if (monthUsdTodayComparison != 0) { return(monthUsdTodayComparison); } var monthCountTodayComparison = MonthCountToday.CompareTo(other.MonthCountToday); if (monthCountTodayComparison != 0) { return(monthCountTodayComparison); } var yearTodayComparison = YearToday.CompareTo(other.YearToday); if (yearTodayComparison != 0) { return(yearTodayComparison); } var yearUsdTodayComparison = YearUsdToday.CompareTo(other.YearUsdToday); if (yearUsdTodayComparison != 0) { return(yearUsdTodayComparison); } return(YearCountToday.CompareTo(other.YearCountToday)); }