コード例 #1
0
        public ActionResult AllPosts()
        {
            BL_Posts    bL_Posts   = new BL_Posts();
            List <Post> posts_List = bL_Posts.Posts.ToList();

            return(View(posts_List));
        }
コード例 #2
0
        public ActionResult Delete(int id)
        {
            BL_Posts bL_Posts = new BL_Posts();

            bL_Posts.DeletePost(id);

            return(RedirectToAction("AllPosts"));
        }
コード例 #3
0
        public ActionResult Create(Post post)
        {
            if (ModelState.IsValid)
            {
                BL_Posts bL_Posts = new BL_Posts();
                bL_Posts.InsertPost(post);

                return(RedirectToAction("AllPosts"));
            }
            return(View());
        }