Ejemplo n.º 1
0
        public ContentResult DeletePost(string id)
        {
            _blogRepository.DeletePost(new Guid(id));

            var json = JsonConvert.SerializeObject(new
            {
                success = true,
                message = "Post deleted successfully."
            });

            return(Content(json, "application/json"));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> OnPostDelete()
        {
            await _posts.DeletePost(ID);

            return(RedirectToPage("/AllPosts"));
        }