Class HostedCommandsService
A wrapper for CommandsService designed to use with .NET Core Host.
Inheritance
Namespace: TehGM.Wolfringo.Hosting.Commands
Assembly: Wolfringo.Hosting.dll
Syntax
public class HostedCommandsService : ICommandsService, IDisposable
Remarks
This wrapper uses CommandsService internally, and delegates all method calls and events.
This class supports configuration changes by using
Constructors
| Improve this Doc View SourceHostedCommandsService(IOptionsMonitor<CommandsOptions>, IServiceProvider, ILogger<HostedCommandsService>, IApplicationLifetime)
Creates a new hosted commands service.
Declaration
public HostedCommandsService(IOptionsMonitor<CommandsOptions> options, IServiceProvider services, ILogger<HostedCommandsService> log, IApplicationLifetime hostLifetime)
Parameters
| Type | Name | Description |
|---|---|---|
| IOptionsMonitor<CommandsOptions> | options | Commands options that will be used as default when running a command. |
| System.IServiceProvider | services | Services provider that will be used by all commands. |
| ILogger<HostedCommandsService> | log | Logger used by hosted commands service. |
| IApplicationLifetime | hostLifetime | Host lifetime that will be used to dispose service when application is exiting. |
Remarks
This wrapper uses CommandsService internally, and delegates all method calls and events.
This class supports configuration changes by using
See Also
Properties
| Improve this Doc View SourceCommands
Descriptors of all commands loaded to this commands service.
Declaration
public IEnumerable<ICommandInstanceDescriptor> Commands { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<ICommandInstanceDescriptor> |
Remarks
This wrapper uses CommandsService internally, and delegates all method calls and events.
This class supports configuration changes by using
See Also
Methods
| Improve this Doc View SourceDispose()
A wrapper for CommandsService designed to use with .NET Core Host.
Declaration
public void Dispose()
Remarks
This wrapper uses CommandsService internally, and delegates all method calls and events.
This class supports configuration changes by using
See Also
Explicit Interface Implementations
| Improve this Doc View SourceICommandsService.ExecuteAsync(ICommandContext, CancellationToken)
Executes commands against a command context.
Declaration
Task<ICommandResult> ICommandsService.ExecuteAsync(ICommandContext context, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| ICommandContext | context | Context to execute commands with. |
| System.Threading.CancellationToken | cancellationToken | Cancellation token to cancel execution with. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ICommandResult> | Result of the execution. |
Remarks
This wrapper uses CommandsService internally, and delegates all method calls and events.
This class supports configuration changes by using
See Also
| Improve this Doc View SourceICommandsService.StartAsync(CancellationToken)
Starts the Command Service.
Declaration
async Task ICommandsService.StartAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Threading.CancellationToken | cancellationToken | Cancellation token to cancel loading with. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Remarks
This wrapper uses CommandsService internally, and delegates all method calls and events.
This class supports configuration changes by using