Ejemplo n.º 1
0
 public ActionResult Create(Blog blog)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _blogUnitOfWork.Blog.Add(blog);
             _blogUnitOfWork.Save();
             return RedirectToAction("Index");
         }
         return View();
     }
     catch (Exception)
     {
         return View();
     }
 }
Ejemplo n.º 2
0
 public ActionResult EditBlog(Int64 id, Blog blog)
 {
     _blogUnitOfWork.Blog.Update(blog);
     _blogUnitOfWork.Save();
     return RedirectToAction("Index");
 }