参考:http://blog.csdn.net/q107770540/article/details/6133484

private static object GetPropertyValue(object obj, string property)
{
    System.Reflection.PropertyInfo propertyInfo=obj.GetType().GetProperty(property);
    return propertyInfo.GetValue(obj, null);
}

主要用到以上方法。

obj为要排序的对象,property为参数。

一般linq查询出来的数据为IQueryable类型,要对其做tolist()处理。

相关文章:

  • 2021-11-06
  • 2021-05-20
  • 2021-08-05
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2022-12-23
猜你喜欢
  • 2021-07-16
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案