For some debug code I'm writing Trace code I'm trying to output the name of the method using MethodBase.GetCurrentMethod().ToString() but I also wanted to output the current methods parameter names and values. Is this possible?
You can get the parameter names (and types, modifiers, attributes etc) via MethodBase.GetParameters but you can't get the values that way. You may want to consider using some form of AOP (such as Postsharp) to add logging for parameter values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With