Can I write generic extension method to run task?
问题 I am calling this method: Windows.Foundation.IAsyncOperation<AppServiceResponse> AppServiceConnection.SendMessageAsync(ValueSet message) e.g. await connection.SendMessageAsync(initialStatus); It shows an error: 'IAsyncOperation' does not contain a definition for "GetAwaiter" and no extension method "GetAwaiter" accepting a first argument of type 'IAsyncOperation'could be found (are you missing a using directive for 'System'?) Then I change it to: await Task.Run(() => connection