public IActionResult Delete(int id)
        {
            var currentArticle = articlesService.GetOneArticle(id);

            if (currentArticle == null)
            {
                return(NotFound());
            }

            articlesService.DeleteArticle(id);
            return(NoContent());
        }
Пример #2
0
        public IActionResult Delete(int id)
        {
            var article = Article.DataSource.Where(m => m.Id == id).FirstOrDefault();

            if (article == null)
            {
                return(NotFound());
            }

            articlesService.DeleteArticle(id);

            return(NoContent());
        }
        public IActionResult Delete(int id)
        {
            articlesService.DeleteArticle(id);

            return(NoContent());
        }
Пример #4
0
 public IActionResult Delete(int id)
 {
     articlesService.DeleteArticle(id);
     return(View("Index"));
 }
Пример #5
0
        public IActionResult DeleteConfirmed(int id)
        {
            articlesService.DeleteArticle(id);

            return(RedirectToAction("Index"));
        }