public ActionResult deleteArticle(int id) { var article = _articleRepo.GetArticleById(id); if (article == null) { return(NotFound()); } _articleRepo.DeleteArticle(article); _articleRepo.SaveChanges(); return(NoContent()); }
public ActionResult DeleteArticle(int id) { var articleModel = _repository.GetArticleById(id); if (articleModel == null) { return(NotFound()); } _repository.DeleteArticle(articleModel); _repository.SaveChanges(); return(NoContent()); }