Exemplo n.º 1
0
        public override bool Equals(System.Object otherRestaurant)
        {
            if (!(otherRestaurant is Restaurant))
            {
                return(false);
            }
            else
            {
                Restaurant newRestaurant       = (Restaurant)otherRestaurant;
                bool       idEquality          = this.getID() == newRestaurant.getID();
                bool       nameEquality        = this.getName() == newRestaurant.getName();
                bool       addressEquality     = this.getAddress() == newRestaurant.getAddress();
                bool       phoneNumberEquality = this.getPhoneNumber() == newRestaurant.getPhoneNumber();
                bool       cuisineIdEquality   = this.getCusineId() == newRestaurant.getCusineId();

                return(idEquality && nameEquality && addressEquality && phoneNumberEquality && cuisineIdEquality);
            }
        }