日期:2014-05-17  浏览次数:20399 次

请问MVC3中如何实现时间倒排,谢谢各位
var db = new DataClasses1DataContext();
  var str = (from r in db.speak 
  select new speaks
  {
  id = r.id,
  submit_time = r.submit_time,
  content = r.content
  }).ToList<speaks>();
  return View(str);
这是我的代码,我现在想按submit_time倒排序查询,orderby submit_time desc,这样的语句在这里该怎么写,谢谢各位

------解决方案--------------------
C# code
  var db = new DataClasses1DataContext();
  var str=db.speak.OrderByDescending(r=>r.submit_time).ToList(); 
  return View(str);