it's only a param Array. You can add an array or you can csv actions, or you can have a single action.
It's just like
String.Format(string format, param object[] args)
. params can be written as the following:
String.Format(myFormatStr,args0,arg1, arg2)
String.Format(myFormatStr,args0)
String.Format(myFormatStr,args[])
String.Format(myFormatStr)
EDIT: Added extra detail:
You can test this yourself and see what happens with a params parameter.
Here is a quick test class you can implement to see how it works:
internal class Program
{
private static void Main()
{
int[] factors = new[] {2, 3, 5};
Console.WriteLine( Product(9) );
Console.WriteLine( Product(2, 3) );
Console.WriteLine( Product(2, 3, 4) );
Console.WriteLine( Product(factors) );
}
private static int Product(params int[] factors)
{
int result = 1;
foreach (int factor in factors)
{
result *= factor;
}
return result;
}
}
So when you see that a parameter is an array but is has
params
in front of it then you don't have to pass an array.
Look - I don't know ElasicSearch which is why I am trying to explain
param Action<<highlighfielddescriptor<><parentdocument>>>>[] fieldhighlighter
instead.
This is what in
might look like:
myHightlightDesc.onFields(f=>f.id);
myHightlightDesc.onFields(f=>f.id, f=>f.name);
myHightlightDesc.onFields(new []{f=>f.id, f=>f.name});
myHightlightDesc.onFields(f=>f.id, f=>f.name, f=>f.columm1+f.column2);
If you still need help the please tell me where you are stuck.
Good luck ^_^