public ActionResult DeleteConfirmed(int id) { RecipeIngredientBridge recipeIngredientBridge = db.RecipeIngredientBridges.Find(id); db.RecipeIngredientBridges.Remove(recipeIngredientBridge); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "RecipeID,IngredientID,IngredientName,MeasurementType,MeasurementQuantity")] RecipeIngredientBridge recipeIngredientBridge) { if (ModelState.IsValid) { db.Entry(recipeIngredientBridge).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IngredientID = new SelectList(db.Ingredients, "IngredientID", "IngredientName", recipeIngredientBridge.IngredientID); ViewBag.RecipeID = new SelectList(db.Recipes, "RecipeID", "RecipeName", recipeIngredientBridge.RecipeID); return(View(recipeIngredientBridge)); }
// GET: RecipeIngredientBridges/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RecipeIngredientBridge recipeIngredientBridge = db.RecipeIngredientBridges.Find(id); if (recipeIngredientBridge == null) { return(HttpNotFound()); } return(View(recipeIngredientBridge)); }
// GET: RecipeIngredientBridges/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RecipeIngredientBridge recipeIngredientBridge = db.RecipeIngredientBridges.Find(id); if (recipeIngredientBridge == null) { return(HttpNotFound()); } ViewBag.IngredientID = new SelectList(db.Ingredients, "IngredientID", "IngredientName", recipeIngredientBridge.IngredientID); ViewBag.RecipeID = new SelectList(db.Recipes, "RecipeID", "RecipeName", recipeIngredientBridge.RecipeID); return(View(recipeIngredientBridge)); }