/// <summary> /// ArticleInfo() method /// returns view of /// the article with tags /// </summary> /// <param name="id">Article Id</param> public ActionResult ArticleInfo(int id) { Article article = db.Articles.Get(id); ArticleTagViewModel articleTag = new ArticleTagViewModel(); articleTag.Article = article; Tag tag; foreach (var t in article.TagArticles) { tag = db.Tags.Get(t.TagID); articleTag.Tags.Add(tag); } if (article == null) { return(HttpNotFound()); } return(View(articleTag)); }
public IActionResult GetTagsByAIAnync([FromBody] ArticleTagViewModel model) => TryCatchR(() => _baiduNaturalLanguageRecognizer.TopicTag(model.Title, model.Content).Items.Select(x => x.Tag));