I understand how to get the names of parameters passed to a method, but let's say I have a method declaration as follows:
static void ParamsTest(string template, params object[] objects)
and I want to use object/property names in my template for substitution with real property values in any of the objects in my `objects' parameter. Let's then say I call this method with:
ParamsTest("Congrats", customer, purchase);
I will only be able to retrieve two parameter names trying to fill out the template, viz, template, and objects, and the names of the objects in the objects collection are forever lost, or not?
I could require a List<object> as my second parameter, but I feel there is somehow a more elegant solution, maybe with a lambda or something. I don't know, I'm not used to using lambdas outside of LINQ.
Dictionary<string,object>, where the string is the name of the variable?ParamTest(customer: customer, purchase:purchase)