// NOTE: You can't have async methods with ref or out parameters.
public async Task Method1()
{
var result = await TestAsync();
int code = result.successCode;
bool error = tuple.error;
}
// A workaround for this is to just return a tuple
public async Task<(int successCode, bool error)> TestAsync()
{
//...
return (1, true);
}