Esempio n. 1
0
        // GET: Comments/Create
        public ActionResult Create(int id)
        {
            var model = _db.GetPost(id);

            if (model == null)
            {
                return(Redirect("Index"));
            }
            var posts = _db.GetAllPosts();

            ViewBag.PostID = new SelectList(posts, "PostId", "Text", model.PostId);
            return(View());
        }