Show / Hide Table of Contents

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
object
CommandBase
AsynchronousCommand
DependencyInjectionCommand
Implements
IAsyncCommand
IDisposable
Inherited Members
AsynchronousCommand.ExecuteAsync()
AsynchronousCommand.OnValidationFailure(List<IArgument>)
AsynchronousCommand.OnExecute()
CommandBase._OutputProvider
CommandBase.ExecutionInfo
CommandBase.Arguments
CommandBase.GetArgValueOrRequiredConfigValue(string, string)
CommandBase.GetArguments()
CommandBase.Description
CommandBase.IsQuietMode
CommandBase.WriteLine(string)
CommandBase.WriteLine()
CommandBase.CreateCommand<T>(Action<Dictionary<string, string>>, bool)
CommandBase.ExecuteCommand<T>(Action<Dictionary<string, string>>, bool)
CommandBase.ExecuteCommandAsync<T>(Action<Dictionary<string, string>>, bool)
CommandBase.DisplayUsage()
CommandBase.DisplayUsage(StringBuilder)
CommandBase.DisplayValidationSummary(List<IArgument>)
CommandBase.Validate()
CommandBase.SetValuesFromExecutionInfo()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Benday.CommandsFramework
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
Type Name Description
CommandExecutionInfo info
ITextOutputProvider outputProvider

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
public void Dispose()
| 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 Description
T
Type Parameters
Name Description
T

Implements

IAsyncCommand
IDisposable
  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com