Edit:
func(params dynamic[] parameters)
{
}
lets it accept variable parameters with variable types. Ignorance is not bliss.
Question:
I need to write a method that takes n number of lists each of different types such as:
List<Type1> list1 = .....;
List<Type2> list2 = .....;
List<TypeN_1> listN_1 = .....;
List<TypeN> listN = .....;
var result=func(list1,list2,listN);
but I couldn't manage with "params" keyword because it doesn't let inner functions know < T > of each list.
public int func< ? ? >(? ? ? ?)
{
int result=0;
... get all lists and put them in some function:
innerFunc(list1);
// which is declared as innerFunc<T>(List<T> p){}
return result;
}
params object[]orparams IEnumerable<object>[]. How are you supposed to know the type of a particular parameter in the function?