I have the following method:
void MyMethod(params object[] args)
{
}
which I am trying to call with a parameter of type object[]
:
object[] myArgs = GetArgs();
MyMethod(myArgs);
It compiles fine, but inside MyMethod
I args == { myArgs}
, i.e. an array with one element that is my original arguments. Obviously I wanted to have args = myArgs
, what am I doing wrong?
EDIT:
Jon Skeet was actually right, the GetArgs()
did wrap the thing in an one element array, sorry for stupid question.