示例#1
0
        public ActionResult Create(Tags tags)
        {
            if (ModelState.IsValid)
            {
                db.Tags.Add(tags);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(tags);
        }
示例#2
0
 public ActionResult Edit(Tags tags)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tags).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(tags);
 }