Пример #1
0
 public ActionResult editpost(Guid id, EditEditPostModel model)
 {
   if (ModelState.IsValid)
   {
     BlogPost p = BlogPostRepository.Get(id);
     p.Update(model.Slug, model.Title, model.Body);
     BlogPostRepository.Update(p);
     return RedirectToAction("posts", "edit", new { id = p.BlogId });
   }
   return View(model);
 }
Пример #2
0
 public ActionResult editpost(Guid id)
 {
   BlogPost p = BlogPostRepository.Get(id);
   Blog b = BlogRepository.Get(p.BlogId);
   EditEditPostModel model = new EditEditPostModel
   {
     Blog = b,
     Title = p.Title,
     Slug = p.Slug,
     Body = p.Body
   };
   return View(model);
 }