Refactor CommandBase.Execute to ExecuteAsync
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
command implementations which require async operations need to run them synchronously using .GetAwaiter().GetResult() or .Wait()
with ExecuteAsync in CommandBase,
https://github.com/dotnet/sdk/blob/f2ae697b809e488cc52775ca635bbed7e2dbabf4/src/Cli/dotnet/CommandBase.cs#L23
and MainAsync in Cli.Program
https://github.com/dotnet/sdk/blob/f2ae697b809e488cc52775ca635bbed7e2dbabf4/src/Cli/dotnet/Program.cs#L23
it will work for both async (remove .Wait(), .GetAwaiter().GetResult()) and sync (with Task.CompletedTask or Task.FromResult).
n.b. CommandBase.Execute is difference than Task.Execute or ICommand.Execute, both of which should also provide Async variant in principle but that's a separate discussion
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.