Ejemplo n.º 1
0
        public bool Delete(Post post)
        {
            PostDTO dto = new PostDTO();

            dto = converter.ModelToDTO(post);
            context.Delete(dto);
            return(true);
        }
Ejemplo n.º 2
0
 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"));
     }
 }
Ejemplo n.º 3
0
 public bool DeletePost(Post post)
 {
     return(_context.Delete(post));
 }
Ejemplo n.º 4
0
 public void Delete(Post post)
 {
     context.Delete(post);
 }