Beispiel #1
0
        public IActionResult DeletePost(string id)
        {
            // Delete from db
            var delete = _process.DeleteComment(id);

            if (delete)
            {
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                var error = new ErrorViewModel()
                {
                    ErrorMessage = "There was an issue deleting your comment"
                };

                return(View("Error", error));
            }
        }