I have a task adapter
public static ServiceReturnObject<T> CheckServiceResult<T>(Task<T> functionTask)
{
ServiceReturnObject<T> serviceReturnObject = new ServiceReturnObject<T>();
var result = functionTask.GetAwaiter().GetResult();
...
}
which i can call with
CheckServiceResult(GetSomaAlgorithmResultAsync(header, AlgoNo));
where GetSomaAlgorithmResultAsync
is a function and header and AlgoNo
are parameters I pass.
This works. No problem.
functionTask.GetAwaiter().GetResult()
works fine with parameters but I cant get the parameters myself. This is here just as a proof of concept that I can run the funcTask with parameters correctly. Dont stay on that.
How can I access parameters (header or AlgoNo) from within CheckServiceResult
?