Class CommandServiceExtensions
Provides extension methods for the CommandService class.
public static class CommandServiceExtensions
- Inheritance
-
CommandServiceExtensions
- Inherited Members
Methods
GetExecutableCommandsAsync(CommandService, ICommandContext, IServiceProvider)
Returns commands that can be executed under the current context.
public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this CommandService commandService, ICommandContext context, IServiceProvider provider)
Parameters
commandService
CommandServiceThe desired command service class to check against.
context
ICommandContextThe current command context.
provider
IServiceProviderThe service provider used for dependency injection upon precondition check.
Returns
- Task<IReadOnlyCollection<CommandInfo>>
A read-only collection of commands that can be executed under the current context.
GetExecutableCommandsAsync(ModuleInfo, ICommandContext, IServiceProvider)
Returns commands that can be executed under the current context.
public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this ModuleInfo module, ICommandContext context, IServiceProvider provider)
Parameters
module
ModuleInfoThe module to be checked against.
context
ICommandContextThe current command context.
provider
IServiceProviderThe service provider used for dependency injection upon precondition check.
Returns
- Task<IReadOnlyCollection<CommandInfo>>
A read-only collection of commands that can be executed under the current context.
GetExecutableCommandsAsync(ICollection<CommandInfo>, ICommandContext, IServiceProvider)
Returns commands that can be executed under the current context.
public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this ICollection<CommandInfo> commands, ICommandContext context, IServiceProvider provider)
Parameters
commands
ICollection<CommandInfo>The set of commands to be checked against.
context
ICommandContextThe current command context.
provider
IServiceProviderThe service provider used for dependency injection upon precondition check.
Returns
- Task<IReadOnlyCollection<CommandInfo>>
A read-only collection of commands that can be executed under the current context.