public ActionResult Create(FullBlogViewModel blog)
 {
     if (!String.IsNullOrWhiteSpace(blog.Name))
     {
         blog.User = _userService.GetUserByNickname(User.Identity.Name)?.ToMvcUser();
         _blogService.CreateBlog(blog.ToBllFullBlog());
         return(RedirectToAction("Index", "Article"));
     }
     return(RedirectToAction("Create", "Blog"));
 }
 public static FullBlogEntity ToBllFullBlog(this FullBlogViewModel fullBlog)
 {
     return new FullBlogEntity()
     {
         Id = fullBlog.Id,
         Name = fullBlog.Name,
         User = fullBlog.User?.ToBllUser(),
         Articles = fullBlog.Articles?.Select(x => x.ToBllFullArticle())
     };
 }
 public ActionResult Delete(FullBlogViewModel fullblog)
 {
     fullblog = _blogService.GetBlogById(fullblog.Id)?.ToMvcFullBlog();
     if (User.Identity.Name != fullblog.User.NickName)
     {
         return(RedirectToAction("Index", "Article"));
     }
     fullblog.Articles = _articleService.GetAllByBlog(fullblog.Id)?.Select(x => _articleService.GetFullArticleEntity(x).ToMvcFullArticle()).ToList();
     _blogService.DeleteBlog(fullblog.ToBllFullBlog());
     return(RedirectToAction("Profile"));
 }