Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public IActionResult Store(ArticleCreateViewModel articleCreateViewModel)
- {
- if (ModelState.IsValid)
- {
- var newArticle = new Article()
- {
- Title = articleCreateViewModel.Title,
- Body = articleCreateViewModel.Body,
- CreatedAt = articleCreateViewModel.CreatedAt,
- };
- _articleRepository.Add(newArticle);
- return RedirectToAction("Show", new { id = newArticle.Id });
- }
- return View("Create");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement