public async Task<ActionResult> AddArticle(AddArticleRequest article) { if (this.ModelState.IsValid) { // Set Random tag just to simplify app var random = new Random(); var tagIds = new List<int>(); tagIds.Add(random.Next(1, 8)); tagIds.Add(random.Next(1, 8)); await this.blogCommandService.CreatArticle(new AddArticleModel { Header = article.Header, Body = article.Body, TeaderText = article.TeaserText, AuthorId = this.User.Identity.GetUserId(), TagsId = tagIds }); return RedirectToAction("MyArticles"); } return View(); }
public ActionResult AddArticle() { var model = new AddArticleRequest(); return View(model); }