public bool Delete(Post post) { PostDTO dto = new PostDTO(); dto = converter.ModelToDTO(post); context.Delete(dto); return(true); }
public IActionResult VerwijderPost(int postId) { try { Post post = postContext.GetById(postId); postContext.Delete(post); return(RedirectToAction("Index")); } catch (SqlException) { //TODO exception netjes afhandelen return(RedirectToAction("Error", "Errors")); } }
public bool DeletePost(Post post) { return(_context.Delete(post)); }
public void Delete(Post post) { context.Delete(post); }