Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you pass a list in an ParamArray parameter

I'm was wondering if you can pass a list into a parameter of ParamArray in a method? For ex.

dt = ws.getTable("baseDivision.code:1",
    "countryCode:CA",
    "status.code:[1+TO+6]",
    "buType.code:(6+7+8+88)",
    "market.code:[0+TO+*]",
    "region.code:[0+TO+*]",
    "!subDivision.code:null",
    "openDate:[*+TO+NOW%2B1MONTH]")

Instead of passing these parameters can you pass a list of strings where each elements contains these parameters.

So kinda like this

dt = ws.getTable(aListOfStringParamters)
like image 758
PopperJuan Avatar asked Dec 07 '25 22:12

PopperJuan


1 Answers

Yes, but the argument must be an array. If the argument is some other kind of enumerable list, then you can use LINQ's ToArray extension method to convert it:

dt = ws.getTable(aListOfStringParamters.ToArray())
like image 63
Steven Doggart Avatar answered Dec 11 '25 00:12

Steven Doggart