示例#1
0
 public ActionResult Create(Post newPost)
 {
     List<Post> posts = GetPosts();
     posts.Add(newPost);
     HttpContext.Application["myPosts"] = posts;
     return RedirectToAction("ViewPost");
 }
示例#2
0
 public ActionResult Create()
 {
     Post post = new Post();
     post.PostDate = DateTime.Now;
     var thePosts = GetPosts();
     post.ID = thePosts.Max(x=>x.ID) + 1;
     return View(post);
 }