示例#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.GetRestaurantName() == newRestaurant.GetRestaurantName());
                bool       cuisineIdEquality = (this.GetCuisineId() == newRestaurant.GetCuisineId());
                bool       addressEquality   = (this.GetAddress() == newRestaurant.GetAddress());
                bool       openTimeEquality  = (this.GetOpenTime() == newRestaurant.GetOpenTime());
                bool       closeTimeEquality = (this.GetCloseTime() == newRestaurant.GetCloseTime());

                return(idEquality && nameEquality && cuisineIdEquality && addressEquality && openTimeEquality && closeTimeEquality);
            }
        }