orderBy()的动态模型查询

时间:2012-06-05 23:13:52

标签: asp.net-mvc asp.net-mvc-3 c#-4.0 lambda

以下是否有相应的内容?

  // convert model to dynamic (this is how the model is coming in)
  IEnumerable<dynamic> dynmodel = (IEnumerable < dynamic >)Model;

  // dynamic lambda ???
  string col = "x.Name";
  var grid = new WebGrid(source: dynmodel.OrderBy(x => @col)); // Doesn't resolve but need an equivalent here!!!

1 个答案:

答案 0 :(得分:1)