Exemple #1
0
        public IHttpActionResult Delete(int id)
        {
            var entry = _blogRepo.GetBlogById(id);

            if (_blogRepo.DeleteBlog(entry) == 1)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
Exemple #2
0
 public ActionResult Details(int id)
 {
     return(View(blogrepo.GetBlogById(id)));
 }
 private BlogPost ExtraireEntite(int?id)
 {
     return(id == null ?
            new BlogPost()
     : _bloguesRepo.GetBlogById(id.GetValueOrDefault()));
 }