public ActionResult AddRecipe(Recipe recipe) { ViewBag.Title = "Add Recipe"; try { if (ModelState.IsValid) { Recipe_DL db = new Recipe_DL(); if (db.SaveData(recipe)) { ModelState.Clear(); } } return(View("Confirmation", recipe)); } catch { return(View()); } }
/// <summary> /// This adds a recipe /// </summary> /// <param name="val"></param> // POST: api/Values public void Post(Recipe val) { recData.SaveData(val); }