EasyUI-Datagrid和LinqToEntity结合应用时排序问题
public ActionResult GetList()
{
//LambdaExpression orderByExp;
if (!string.IsNullOrEmpty(Request["sort"]))
{
//通过post过来的数据拿到排序的字段
Type type = typeof(RPT_NEW_BAK_CHK_LST);
PropertyInfo property = type.GetProperty(Request["sort"]);
ParameterExpression parameter = Expression.Parameter(type, "p");
MemberExpression propertyAccess = Expression.MakeMemberAccess(parameter, property);
LambdaExpression orderByExp = Expression.Lambda(propertyAccess, parameter);
//问题在此行,有时候字段是string ,有时候字段是int ,下一行应该怎么写呢???
Expression<Func<RPT_NEW_BAK_CHK_LST, int>> order = (Expression<Func<RPT_NEW_BAK_CHK_LST, int>>)orderByExp;
}