public ActionResult Add(ArticleViewModel model) { var article = Mapper.Map<ArticleViewModel, Article>(model); article.PublishDate = DateTime.Now; var response = _articleManager.Publish((User)Session["LoggedInUser"], article); if (response.Success) { return RedirectToAction("Index", "Home"); } ModelState.AddModelError("", "Invalid login attempt."); return View("Manage", model); }
public ActionResult Manage() { var model = new ArticleViewModel(); model.Authors = Mapper.Map<IList<Author>, IList<Models.NewArticleViewModel.AuthorViewModel>>(_articleManager.GetAllAuthors()); return View(model); }