public int AddArticle(Article article)
 {
     if (article.ID == 0)
     {
         _context.BlogRepository.Add(article.ForSql());
     }
     _context.SaveChanges();
     return _context.BlogRepository.Where(x => x.UserID == article.UserID).Max(y => y.ID);
 }
 public void EditArticle(Article article, int userID)
 {
 }
 public ActionResult SaveArticle(Article article)
 {
     Article temp;
     temp = article.ID != 0 ? _blogRepository.GetArticle(article.ID) : new Article();
     temp.Text = article.Text;
     temp.ArticleShortName = article.ArticleShortName;
     temp.Date = DateTime.Now;
     temp.UserID = GetUserID();
     _blogRepository.AddArticle(temp);
     ViewBag.Article = _blogRepository.LastArticle.Text;
     return RedirectToAction("Index");
 }