private static Task <int> CreateRootCommand(CommandContext commandContext, ExecutionDelegate next) { var config = commandContext.AppConfig.Services.GetOrThrow <Config>(); commandContext.RootCommand = ClassCommandDef.CreateRootCommand(config.RootCommandType, commandContext); return(next(commandContext)); }
private static Task <int> CreateRootCommand( CommandContext commandContext, ExecutionDelegate next, Type rootCommandType) { commandContext.RootCommand = ClassCommandDef.CreateRootCommand(rootCommandType, commandContext); return(next(commandContext)); }
/// <summary> /// Returns the list of all possible types that could be instantiated to execute commands.<br/> /// Use get the list of types to register in your DI container. /// </summary> public static IEnumerable <Type> GetCommandClassTypes(this AppRunner appRunner) => ClassCommandDef.GetAllCommandClassTypes(appRunner.RootCommandType);