获得指定属性的名称

  public static string GetPropName<T>(Expression<Func<T>> e)
  {
   var member = (MemberExpression)e.Body;
   return member.Member.Name;
  }

而另一种情况是直接获取属性名称

typeof(aInstanceOfClass).GetProperties();

循环取到的集合

原文地址:https://www.cnblogs.com/CoderMonkie/p/6567423.html