public IActionResult OnPost(EditArticleVM model) { Categories = new SelectList(_categoryApplication.GetAllForSearch(), "Id", "Name"); if (!ModelState.IsValid) { return(Page()); } var result = _articleApplication.Edit(model); if (result.IsSucceeded) { return(RedirectToPage("Index")); } return(Page()); }
public IActionResult OnPost(EditArticle EditArticle) { _articleApplication.Edit(EditArticle); return(RedirectToPage("Index")); }
//public IActionResult OnPost(EditArticle command) //{ // var result = _articleApplication.Edit(command); // return RedirectToPage("./Index"); //} //public IActionResult OnPost(EditArticle command, string slug) //{ // var result = _articleApplication.Edit(command); // return RedirectToPage("./Index", new { Id = slug }); //} public IActionResult OnPost(EditArticle command) { var result = _articleApplication.Edit(command); return(RedirectToPage("./Index")); }
public RedirectToPageResult OnPost() { _articleApplication.Edit(Article); return(RedirectToPage("./List")); }