public int CompareTo(MatchPersonViewModel other) { if (MatchEventStartType == null) { return(1); } if (other.MatchEventStartType == null) { return(-1); } if (MatchEventStartType != other.MatchEventStartType) { return(MatchEventStartType > other.MatchEventStartType ? 1 : -1); } if (PositionType != other.PositionType) { return(PositionType > other.PositionType ? 1 : -1); } return(PersonName.CompareTo(other.PersonName)); }