public override bool Equals(System.Object randomRecipe) { if (!(randomRecipe is Recipe)) { return(false); } else { Recipe newRecipe = (Recipe)randomRecipe; bool idEquality = (this.GetId() == newRecipe.GetId()); bool nameEquality = (this.GetName() == newRecipe.GetName()); bool instructionEquality = (this.GetInstruction() == newRecipe.GetInstruction()); bool ratingEquality = (this.GetRating() == newRecipe.GetRating()); return(idEquality && nameEquality && instructionEquality && ratingEquality); } }