public static IServiceCollection AddFtpClient(this IServiceCollection services, string?name,
                                                      Action <IFtpClientOptions>?configureClient)
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }

            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            if (configureClient == null)
            {
                throw new ArgumentNullException(nameof(configureClient));
            }

            VerifyUniqueOptionsName(services, name);

            AddFtpClient(services);

            var builder = new FtpClientBuilder(services, name);

            builder.ConfigureClient(configureClient);

            return(services);
        }
        public static IServiceCollection AddFtpClient <TInterface, TImplementation>(this IServiceCollection services,
                                                                                    Action <IFtpClientOptions>?configureClient)
            where TInterface : class
            where TImplementation : class, TInterface
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }

            if (configureClient == null)
            {
                throw new ArgumentNullException(nameof(configureClient));
            }

            VerifyUniqueServiceType <TImplementation>(services);

            var optionsName = typeof(TImplementation).Name;

            VerifyUniqueOptionsName(services, optionsName);

            AddFtpClient(services);

            var builder = new FtpClientBuilder(services, optionsName);

            builder.ConfigureClient(configureClient);
            builder.AddTypedClient <TInterface, TImplementation>();

            return(services);
        }
        public static IServiceCollection AddFtpClient <T>(this IServiceCollection services) where T : class
        {
            if (services == null)
            {
                throw new ArgumentNullException(nameof(services));
            }

            VerifyUniqueServiceType <T>(services);

            AddFtpClient(services);

            var builder = new FtpClientBuilder(services, typeof(T).Name);

            builder.AddTypedClient <T>();

            return(services);
        }