c# - What is the most efficient way to ask a MethodInfo how many parameters it takes? -


what efficient way ask methodinfo if accepts parameters and, if so, how many?

my current solutions be: methodinfo.getparameters().any() , methodinfo.getparameters().count().

is efficient way?

since don't need of parameterinfo objects, there way without call getparameters()?

the 2 listed linq. any() returns bool - stating there @ least one. count() used on ienumerable<t>.

length (the property) fastest because getparameters() returns parameterinfo[].

it not appear methodinfo have other way access number of parameters other getparameters().


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -