Ejemplo n.º 1
0
 public ActionResult Index()
 {
     var datacontext = new SiteDataDataContext();
     HomePageViewModel model = new HomePageViewModel();
     model.MostRecentBlogPost = datacontext.BlogPosts.OrderByDescending(post => post.Date).First();
     return View(model);
 }
 //
 // GET: /WaiGuoAtHome/
 public ActionResult Index()
 {
     var blogContext = new SiteDataDataContext();
     List<BlogPost> blogPosts = blogContext.BlogPosts.Take(10).ToList();
     return View(blogPosts);
 }