Пример #1
0
 public IActionResult Modify(BlogModifyModel blogModify)
 {
     if (ModelState.IsValid)
     {
         var blog          = ModelConverter.ConvertFromBlogModify(blogModify);
         var blogConverted = SectionConverter.ConvertToSection(blog);
         BlogService.UpdateBlog(blogConverted);
         return(RedirectToAction("ModifyOverview"));
     }
     else
     {
         return(View(blogModify));
     }
 }
Пример #2
0
 public IActionResult Create(BlogCreateModel blogCreate)
 {
     if (ModelState.IsValid)
     {
         var blog      = ModelConverter.ConvertFromCreateModel(blogCreate);
         var converted = SectionConverter.ConvertToSection(blog);
         BlogService.CreateBlog(converted);
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View(blogCreate));
     }
 }