I've ended up with two procedures, with very similar arguments and identical functionality, whose arguments are as follows:
private string BuildResponse(string value1, string value2, params string[] parameters)
private string BuildResponse(MyObject values, params string[] parameters)
In this case, MyObject has two properties; value1 and value2. I was initially trying to implement the second as follows:
private string BuildResponse(MyObject values, params string[] parameters) {
return BuildResponse (values.value1, values.value2, parameters);
}
Unfortunately, the compiler threw a warning relating to the best overloaded method match for ... - i.e. I couldn't simply pass parameters (which is a string[]) through like this.
So - how can I pass a string[] into a method whose signature ends with a params variable?
(I'm now replacing the params string[] with another collection type instead hence the past tense, but it would be interesting to know whether what I was trying to do was even possible. If it isn't, feel free to state "no" and provide references)