Method AddSshClient
- Namespace
- Microsoft.Extensions.DependencyInjection
- Assembly
- SshSharp.Extensions.DependencyInjection.dll
AddSshClient(IServiceCollection, string)
Registers the SSH endpoint name, with ISshClientFactory and ISshConnectionProvider.
Configure it through the returned builder, for example .BindConfiguration("Ssh:Deploy") or .Configure(o => ...),
and add .ValidateOnStart() to check its settings when the host starts.
public static OptionsBuilder<SshEndpointOptions> AddSshClient(this IServiceCollection services, string name)
Parameters
servicesIServiceCollectionnamestring
Returns
- OptionsBuilder<SshEndpointOptions>
The named options builder for the endpoint's SshEndpointOptions.
AddSshClient(IServiceCollection, string, Action<SshEndpointOptions>)
Registers the SSH endpoint name, configured by configure.
public static OptionsBuilder<SshEndpointOptions> AddSshClient(this IServiceCollection services, string name, Action<SshEndpointOptions> configure)
Parameters
servicesIServiceCollectionnamestringconfigureAction<SshEndpointOptions>
Returns
- OptionsBuilder<SshEndpointOptions>
The named options builder for the endpoint's SshEndpointOptions.