Is there any dark, hidden way to convert all method parameters to an object []?
When introducing integration between the two systems using a message broker, I noticed that most of the methods open by the broker use many parameters.
I want an easy way to log every broker call with every parameter. Something like:
[WebMethod] public void CreateAccount(string arg1, int arg2, DateTime arg3, ... ) { object[] args = GetMethodArgs(); string log = args.Aggregate("", (current, next) => string.Format("{0}{1};", current, next)); Logger.Log("Creating new Account: " + args);
I am wondering if C # provides something that mimics GetMethodArgs ();
c # log4net
dcarneiro
source share