i got a code for calling a function until meet the condition but i am not in very advance stage so code which i got not at all clear to me. here i will submit the code i got…please some one discuss about how the code works in detail.
public static void RunToFirstMatch<T>(Func<T, bool> sentry, params Func<T>[] functions)
{
functions.Any(f => match(f()));
}
The code is called as follows
RunToFirstMatch(v => (v >= 5), Step1, ()=>Step2(1,1), Step3, Step4, ()=>0+1);
RunToFirstMatch function take 2 argument but when this function is getting called then many argument is passing….i just do not understand about the calling of the function. please discuss thanks.
The second argument,
params Func<T>[] functions, actually means “allow manyFunc<T>s to be passed as subsequent arguments, and present them in an array calledfunctions.” This is caused by the params keyword.Thus when you call
you get