public int CompareTo(object obj) { var comparable = (PlayerModel)obj; int x; x = Name.CompareTo(comparable.Name); if (x != 0) { return(x); } x = LastName.CompareTo(comparable.LastName); if (x != 0) { return(x); } x = Club.CompareTo(comparable.Club); if (x != 0) { return(x); } return(x); }