I have some legacy code that uses asmx
web methods. I have no control over the decision to use any other technology but I need to modify it a little.
The method currently returns a custom object, but I need to modify it to call an awaited method, so the method should now become async
and the return value is now forced to become Task<Object>
Is there a way to return Object
instead of Task<Object>
? Here's a sample of my code:
[WebMethod]
public async Task<Foo> DoSomethingAwaited()
{
return await WaitForMe();
}