Exemplo n.º 1
0
 public override bool Equals(System.Object otherRestaurant)
 {
     if (!(otherRestaurant is Restaurant))
     {
         return(false);
     }
     else
     {
         Restaurant newRestaurant  = (Restaurant)otherRestaurant;
         bool       nameEquals     = this.GetName() == newRestaurant.GetName();
         bool       idEquals       = this.GetCuisineId() == newRestaurant.GetCuisineId();
         bool       dateEquals     = this.GetDateTime() == newRestaurant.GetDateTime();
         bool       locationEquals = this.GetLocation() == newRestaurant.GetLocation();
         return(nameEquals && idEquals && dateEquals && locationEquals);
     }
 }