Пример #1
0
 public IActionResult Delete(PostDeleteVm postVm)
 {
     try
     {
         _postService.DeletePost(postVm);
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         ViewData["Erro"] = ex.Message;
         return(View("_Erro"));
     }
 }
Пример #2
0
        public void DeletePost(PostDeleteVm postVm)
        {
            var post = this._repository.GetById(postVm.PostId);

            this._repository.Delete(post);
        }