Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
 public IActionResult OnPost(EditArticle EditArticle)
 {
     _articleApplication.Edit(EditArticle);
     return(RedirectToPage("Index"));
 }
Exemplo n.º 3
0
        //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"));
        }
Exemplo n.º 4
0
 public RedirectToPageResult OnPost()
 {
     _articleApplication.Edit(Article);
     return(RedirectToPage("./List"));
 }