开发者

C# get method string name using expressions

开发者 https://www.devze.com 2022-12-16 09:45 出处:网络
I need somet开发者_开发知识库hing like this: public string GetName<Type>(Expression<Somestuffhere>) // will bet GetName<Foo>(o => o.Do())

I need somet开发者_开发知识库hing like this:

public string GetName<Type>(Expression<Somestuffhere>) // will bet GetName<Foo>(o => o.Do())
{
   ...
   return "Execute";
}


it is(expression.Body as MethodCallExpression).Method.Name

0

精彩评论

暂无评论...
验证码 换一张
取 消