-1
    //
    // GET: /Posts/

    public ViewResult Index()
    {
        return View(postRepository.AllIncluding(post => post.Comments));
    }

I want to modify the code above to display in reverse order by PublishDate column.

1 Answers1

1

Examples can be found here:

  1. MSDN LINQ Samples
  2. your problem seems similar to this answered question on OrderByDescending
Community
  • 1
  • 1
Thomas Bates
  • 677
  • 4
  • 15
  • Thank You..I have found a solution that work for me var sort = from x in db.Posts select x; sort = sort.OrderByDescending(x => x.PublishDate); return View(sort.ToList()); – Nico Sevilla Mar 13 '12 at 00:42