Skip to content
DocsTry Aspire
DocsTry

AspireSftpExtensions Methods

ClassMethods2 members
Provides extension methods for registering SFTP-related services in an Hosting.IHostApplicationBuilder.
AddKeyedSftpClient(IHostApplicationBuilder, string, Action<SftpSettings>)Section titled AddKeyedSftpClient(IHostApplicationBuilder, string, Action<SftpSettings>)extension
Registers SshNet.SftpClient as a keyed singleton for the given name in the services provided by the builder.
public static class AspireSftpExtensions
{
public static void AddKeyedSftpClient(
this IHostApplicationBuilder builder,
string name,
Action<SftpSettings>? configureSettings = null)
{
// ...
}
}
builderIHostApplicationBuilderThe Hosting.IHostApplicationBuilder to read config from and add services to.
namestringThe connection name to use to find a connection string.
configureSettingsAction<SftpSettings>optionalAn optional method that can be used for customizing the SftpSettings. It's invoked after the settings are read from the configuration.
AddSftpClient(IHostApplicationBuilder, string, Action<SftpSettings>)Section titled AddSftpClient(IHostApplicationBuilder, string, Action<SftpSettings>)extension
Registers SshNet.SftpClient as a singleton in the services provided by the builder.
public static class AspireSftpExtensions
{
public static void AddSftpClient(
this IHostApplicationBuilder builder,
string connectionName,
Action<SftpSettings>? configureSettings = null)
{
// ...
}
}
builderIHostApplicationBuilderThe Hosting.IHostApplicationBuilder to read config from and add services to.
connectionNamestringThe connection name to use to find a connection string.
configureSettingsAction<SftpSettings>optionalAn optional method that can be used for customizing the SftpSettings. It's invoked after the settings are read from the configuration.