/// <summary>
        /// Returns true if BrandedFoodObjectDietLabels instances are equal
        /// </summary>
        /// <param name="other">Instance of BrandedFoodObjectDietLabels to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BrandedFoodObjectDietLabels other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Vegan == other.Vegan ||
                     Vegan != null &&
                     Vegan.Equals(other.Vegan)
                     ) &&
                 (
                     Vegetarian == other.Vegetarian ||
                     Vegetarian != null &&
                     Vegetarian.Equals(other.Vegetarian)
                 ) &&
                 (
                     GlutenFree == other.GlutenFree ||
                     GlutenFree != null &&
                     GlutenFree.Equals(other.GlutenFree)
                 ));
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Vegan != null)
         {
             hashCode = hashCode * 59 + Vegan.GetHashCode();
         }
         if (Vegetarian != null)
         {
             hashCode = hashCode * 59 + Vegetarian.GetHashCode();
         }
         if (GlutenFree != null)
         {
             hashCode = hashCode * 59 + GlutenFree.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 3
0
        public IActionResult Dish()
        {
            string DishChoosen = Request.Form["MenuChoice"];

            string[] finalDish;

            Beef       beef    = new Beef();
            Chicken    chicken = new Chicken();
            Vegetarian vege    = new Vegetarian();

            switch (DishChoosen)
            {
            case "Beef":
                finalDish = beef.MyDish();
                break;

            case "Chicken":
                finalDish = chicken.MyDish();
                break;

            case "Vegetarian":
                finalDish = vege.MyDish();
                break;

            default:
                finalDish = beef.MyDish();
                break;
            }

            ViewBag.Dish          = DishChoosen;
            ViewBag.Starter       = finalDish[0];
            ViewBag.Main          = finalDish[1];
            ViewBag.Accompaniment = finalDish[2];
            ViewBag.Dessert       = finalDish[3];
            ViewBag.Drink         = finalDish[4];

            return(View());
        }