protected async Task ExecuteAsync(OleMenuCmdEventArgs e)
{
using var scope = this._serviceProvider.CreateScope();
BaseDICommand instance = (BaseDICommand)scope.ServiceProvider.GetRequiredService(typeof(T));
Task executeAsyncTask = (Task)_executeAsyncMethod.Invoke(instance, new object[] { e });
await executeAsyncTask;
}
The OleMenuCommand will Invoke the CommandWapper Execute method. This will invoke the BaseCommand Execute which will invoke the BaseCommand ExecuteAsync if not overridden.
https://github.com/VsixCommunity/Community.VisualStudio.Toolkit.DependencyInjection/blob/639e8340345a0d528670b70f7817af662d64c01a/src/Core/Shared/CommandWrapper.cs#L62
The OleMenuCommand will Invoke the CommandWapper Execute method. This will invoke the BaseCommand Execute which will invoke the BaseCommand ExecuteAsync if not overridden.