Example #1
0
        public ActionResult Create(Tool tool)
        {
            if (ModelState.IsValid)
            {
                ProviderContext.Tools.Add(tool);
                ProviderContext.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(tool);
        }
Example #2
0
 public ActionResult Create()
 {
     var model = new Tool();
     return View(model);
 }
Example #3
0
 public ActionResult Edit(Tool tool)
 {
     if (ModelState.IsValid)
     {
         ProviderContext.Entry(tool).State = EntityState.Modified;
         ProviderContext.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(tool);
 }