public bool Equal(City c) { // If parameter is null return false: if ((City)c == null) { return false; } // Return true if the fields match: return (this.Name.Equals(c.Name) && this.Country.Equals(c.Country)); }