I want to use FluentFTP in .NET6. Is there best practice to add FluentFtp.FtpClient to IServiceCollection? Is there any implementation like IHttpClientFactory & AddHttpClient?
I tried the following code. It works but not best.
Some my wrapper
public class MyFtpClient
{
private readonly FluentFTP.FtpClient _client;
public MyFtpClient(MyFtpClientSettings settings)
{
_client = new FtpClient(); // create instance with settings
}
}
In Porgram.cs
services.AddScoped(x => new MyFtpClient(settings);