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")); }
public async Task <IActionResult> OnPostDelete() { await _posts.DeletePost(ID); return(RedirectToPage("/AllPosts")); }