public ActionResult Delete(FullArticleViewModel fullArticle, int blogId, int userId)
 {
     fullArticle.User = _userService.GetUserEntity(userId)?.ToMvcUser();
     fullArticle.Blog = _blogService.GetSimpleBlogById(blogId)?.ToMvcSimpleBlog();
     _articleService.DeleteArticle(fullArticle.ToBllFullArticle());
     return(RedirectToAction("Index"));
 }
 public ActionResult Create(FullArticleViewModel articleViewModel, int[] Tags, HttpPostedFileBase PictureInput, int BlogId = 0)
 {
     if (ModelState.IsValidField("Text") && ModelState.IsValidField("Title"))
     {
         if (BlogId == 0 || Tags == null)
         {
             return(RedirectToAction("Create"));
         }
         articleViewModel.CreationTime = DateTime.Now;
         articleViewModel.Tags         = Tags.Select(x => _tagService.GetTagEntity(x)?.ToMvcSimpleTag());
         articleViewModel.User         = _userService.GetUserByNickname(User.Identity.Name)?.ToMvcUser();
         articleViewModel.Blog         = _blogService.GetSimpleBlogById(BlogId).ToMvcSimpleBlog();
         var str = new StringBuilder();
         if (PictureInput != null)
         {
             str.Append(ImageHelper.SaveTitleImgToDisk(PictureInput, Server.MapPath("~/")));
         }
         articleViewModel.TitleImage = "/ArticlesContent/" + str;
         _articleService.CreateFullArticleEntity(articleViewModel.ToBllFullArticle());
         return(RedirectToAction("Index"));
     }
     return(RedirectToAction("Create"));
 }