AsyncGenerator
AsyncGenerator copied to clipboard
Convert boolean expression to if statements to reduce async/await generation
public bool AMethod()
{
return someSimpleCondition || AnotherMethod();
}
Now would be generated to:
public async Task<bool> AMethodAsync()
{
return someSimpleCondition || await AnotherMethodAsync();
}
Would be nice to generate following:
public Task<bool> AMethodAsync()
{
// wrapped in cancellation token & exception handling bolierplate code.
if (someSimpleCondition)
return Task.FromResult(true);
return AnotherMethodAsync();
}