I've been looking around online for a good long while now and I know how to view all items from database. However what I want to do is show the latest three posts (database items) by date it was added.
Here's my code from the controller which shows all the posts on my index view
public ActionResult index()
{
return View(db.posts.ToList());
}
How can I change this method to do what I want?