Class DependencyInjectionCommand
Base class for commands that use dependency injection.
The service collection is validated lazily when services are first accessed,
allowing commands to be instantiated for schema discovery without DI configuration.
Inheritance
DependencyInjectionCommand
Assembly: Benday.CommandsFramework.dll
Syntax
public abstract class DependencyInjectionCommand : AsynchronousCommand, IAsyncCommand, IDisposable
Constructors
|
Edit this page
View Source
DependencyInjectionCommand(CommandExecutionInfo, ITextOutputProvider)
Declaration
protected DependencyInjectionCommand(CommandExecutionInfo info, ITextOutputProvider outputProvider)
Parameters
Methods
|
Edit this page
View Source
Dispose()
Disposes the service scope for this command. The shared service provider is not
disposed because it belongs to the program rather than to any one command.
Declaration
|
Edit this page
View Source
Dispose(bool)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type |
Name |
Description |
| bool |
disposing |
|
|
Edit this page
View Source
GetRequiredService<T>()
Get a required service instance from the service provider.
Declaration
protected T GetRequiredService<T>() where T : notnull
Returns
Type Parameters
Implements