public IActionResult OnPost(string title, string text, string[] tags) { if (Image != null && title != null && text != null) { int id = ArticleOps.AddArticle(Image, title, text, Request.Cookies["user_id"]); TagsOps.AddTagsToArticleIndex(tags, id); return(Redirect("./Article/" + id)); } else { return(Redirect("./ArticleConstructor")); } }
public void OnGet(int index) { ArticlePars = ArticleOps.GetArticle(index); var articleTags = TagsOps.GetArticleTags(index).Select(x => x.Name).ToList(); if (articleTags != null) { tags = articleTags; } if (Request.Cookies["user_id"] != null) { CountArticleToUser = new Сommunication.Articles_to_users(index, int.Parse(Request.Cookies["user_id"])).CountComs(); } }