public override bool Equals(System.Object otherRecipe) { if (!(otherRecipe is Recipe)) { return(false); } else { Recipe newRecipe = (Recipe)otherRecipe; bool idEquality = this.GetId() == newRecipe.GetId(); bool nameEquality = this.GetName() == newRecipe.GetName(); bool ingredientsEquality = this.GetIngredients() == newRecipe.GetIngredients(); bool instructionsEquality = this.GetInstructions() == newRecipe.GetInstructions(); bool ratingEquality = this.GetRating() == newRecipe.GetRating(); return(idEquality && nameEquality && ingredientsEquality && instructionsEquality && ratingEquality); } }