Is there a way to get an array of the arguments passed to a method?

后端 未结 9 1339
小蘑菇
小蘑菇 2020-12-05 18:17

Say I have a method:

 public void SomeMethod(String p1, String p2, int p3)
 {

 #if DEBUG
    object[] args = GetArguments();
    LogParamaters(args);
 #endi         


        
9条回答
  •  误落风尘
    2020-12-05 18:32

    There's some functionality with the dynamic type system that can do it, but then your class needs to inherit from the dynamic base classes

提交回复
热议问题