예제 #1
0
        public ActionResult Create(Board board)
        {
            if (ModelState.IsValid)
            {
                db.Boards.Add(board);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(board);
        }
예제 #2
0
 public ActionResult Edit(Board board)
 {
     if (ModelState.IsValid)
     {
         db.Entry(board).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(board);
 }