I cannot come up with the correct definition of MyMethodAsync , which would allow it to return the general T obtained from Task , not knowing at compile time that this type either accepts any parameter.
If you really return Task or Task<T> , you can update your signature to reflect this fact and avoid the problem.
If you really need some type derived from Task , then you will need to rewrite your logic, instead return Task or Task<T> and wrap around this other type. Assuming this is unacceptable, you will need to reset async and process the state machine yourself.
Guvante
source share