public static IServiceCollection AddKestrelClient(this IServiceCollection services)
 {
     HttpClientFactoryServiceCollectionExtensions.AddHttpClient(services);
     services.AddMicroCore();
     services.AddMicroClient();
     services.AddSingleton <ITransportClientFactory, HttpTransportClientFactory>();
     return(services);
 }
        public static void ResolveInfrastructureServices(this IServiceCollection services, IConfiguration config)
        {
            services.ConfigureDBContextPool(config);
            services.AddScoped <IAuthentication, AuthenticationRepository>();
            services.AddScoped <ILikeRepository, LikeRepository>();
            services.AddScoped <IArticleRepository, ArticleRepository>();
            services.AddScoped <IUserRepository, UserRepository>();
            services.AddSingleton <IFileLogger, AppLoggerService>();

            services.AddHttpClient("BypassCertificateHttpClient").ConfigurePrimaryHttpMessageHandler(() =>
            {
                var clientHandler = new HttpClientHandler
                {
                    ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return(true); }
                };
                return(clientHandler);
            });
            HttpClientFactoryServiceCollectionExtensions.AddHttpClient(services);
        }