Example #1
0
 public ActionResult Edit(Tag tag)
 {
     if (ModelState.IsValid)
     {
         context.Entry(tag).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(tag);
 }
Example #2
0
        public ActionResult Create(Tag tag)
        {
            if (ModelState.IsValid)
            {
                context.Tags.Add(tag);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(tag);
        }