Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Ingredient_Recipe_Link ingredient_Recipe_Link = db.Ingredient_Recipe_Links.Find(id);

            db.Ingredient_Recipe_Links.Remove(ingredient_Recipe_Link);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "LinkId,RecipeId,IngredientId")] Ingredient_Recipe_Link ingredient_Recipe_Link)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ingredient_Recipe_Link).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(ingredient_Recipe_Link));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "LinkId,RecipeId,IngredientId")] Ingredient_Recipe_Link ingredient_Recipe_Link)
        {
            if (ModelState.IsValid)
            {
                db.Ingredient_Recipe_Links.Add(ingredient_Recipe_Link);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(ingredient_Recipe_Link));
        }
Beispiel #4
0
        // GET: Ingredient_Recipe_Link/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Ingredient_Recipe_Link ingredient_Recipe_Link = db.Ingredient_Recipe_Links.Find(id);

            if (ingredient_Recipe_Link == null)
            {
                return(HttpNotFound());
            }
            return(View(ingredient_Recipe_Link));
        }