/// <summary>
/// Delegate for executing an asynchronous request.
/// </summary>
public delegate void ExecuteRequestDelegate<T>(LazyResult<T> response);
public void FetchAsync([Optional] ExecuteRequestDelegate<TResponse> methodToCall)
{
GetAsyncResponse(
(IAsyncRequestResult state) =>
{
var result = new LazyResult<TResponse>(() =>
{
// Retrieve and convert the response.
IResponse response = state.GetResponse();
return FetchObject(response);
});
// Only invoke the method if it was set.
if (methodToCall != null)
{
methodToCall(result);
}
else
{
result.GetResult();
}
});
}
I want to call now FetchAsync but I don't know how
service.Userinfo.Get().FetchAsync(new ExecuteRequestDelegate<Userinfo>() {...});
and I get back that ExecuteRequestDelegate does not contain an constructor that takes 0 arguments.
What can I do? I want to get Userinfo data?