In a windows 8 application in C#/XAML, I sometimes want to call an awaitable method from a non asynchronous method.
Actually is it correct to replace this :
public async Task<string> MyCallingMethod()
{
string result = await myMethodAsync();
return result;
}
by this :
public string MyCallingMethod()
{
Task.Run(async () => {
string result = await myMethodAsync();
return result;
});
}
The advantage for me is that I can use MyCallingMethod without await but is this correct? This can be an advantage if I want to pass a ref parameter for MyCallingMethod since It is not possible to have ref parameters in an async method.