コード例 #1
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var post = db.Post.Find(id);

            if (post == null)
            {
                return(HttpNotFound());
            }

            var viewModel = new DeleteBlogViewModel
            {
                BlogId = post.Id
            };

            return(View(viewModel));
        }