Can I get specific metadata from a Func?

前端 未结 4 574
逝去的感伤
逝去的感伤 2021-02-04 17:16

Consider the following code:

string propertyName;
var dateList = new List() { DateTime.Now };
propertyName = dateList.GetPropertyName(dateTimeObj         


        
4条回答
  •  野的像风
    2021-02-04 18:07

    Just a side note: func.Method.GetParameters()[0].Name is extremelly fast when compared with compiling the lambda and extracting the member expression, then the member info, then the name.

提交回复
热议问题