//GET: /RecipeIngredients/
        /// <summary>
        ///  
        /// </summary>
        /// <param name="recid"></param>
        /// <returns></returns>
        public ActionResult RecipeIngredients(int recid)
        {
            SpeedyChefDataContext scdc = new SpeedyChefDataContext();
             IEnumerable<RecipeIngredientsResult> recipeIngredients = null;

             recipeIngredients = scdc.RecipeIngredients(recid);
             return Json(recipeIngredients, JsonRequestBehavior.AllowGet);
               /* Food_Item[] tempResult = new Food_Item[4];
            tempResult[0] = new Food_Item();
            tempResult[0].Foodname = "2 small garlic cloves";
            tempResult[1] = new Food_Item();
            tempResult[1].Foodname = "2 sticks unsalted butter";
            tempResult[2] = new Food_Item();
            tempResult[2].Foodname = "1 1/2 teaspoons finely chopped flat-leaf parsley";
            tempResult[3] = new Food_Item();
            tempResult[3].Foodname = "2 (1 1/4-pound) live lobsters";
            return Json(tempResult, JsonRequestBehavior.AllowGet); */
        }
Exemple #2
0
        //GET: /RecipeIngredients/
        /// <summary>
        ///
        /// </summary>
        /// <param name="recid"></param>
        /// <returns></returns>
        public ActionResult RecipeIngredients(int recid)
        {
            SpeedyChefDataContext scdc = new SpeedyChefDataContext();
            IEnumerable <RecipeIngredientsResult> recipeIngredients = null;

            recipeIngredients = scdc.RecipeIngredients(recid);
            return(Json(recipeIngredients, JsonRequestBehavior.AllowGet));

            /* Food_Item[] tempResult = new Food_Item[4];
             * tempResult[0] = new Food_Item();
             * tempResult[0].Foodname = "2 small garlic cloves";
             * tempResult[1] = new Food_Item();
             * tempResult[1].Foodname = "2 sticks unsalted butter";
             * tempResult[2] = new Food_Item();
             * tempResult[2].Foodname = "1 1/2 teaspoons finely chopped flat-leaf parsley";
             * tempResult[3] = new Food_Item();
             * tempResult[3].Foodname = "2 (1 1/4-pound) live lobsters";
             * return Json(tempResult, JsonRequestBehavior.AllowGet); */
        }