I have a function:
private static Response WaitForAPIReply(Func<Response> f)
{
while (true)
{
var response = f();
if (response.MISSING == "WAIT")
{
Console.WriteLine("WAIT");
Thread.Sleep(TimeSpan.FromSeconds(0.1));
}
else
{
return response;
}
}
}
And I call WaitForAPIReply
as:
private static Response GetTestData(int a, string b)
{
return WaitForAPIReply(() => GetData(a, b));
}
I want to add one out
parameter in GetData
and use this in WaitForAPIReply
function. But I am unable to modify WaitForAPIReply
for this?
I searched over web could see I can use delegate. But I am unable to fix this while passing as parameter to WaitForAPIReply