private void RegisterDependencies(IServiceCollection services)
        {
            //services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
            services.AddSingleton <IWebConfigurationService, WebConfigurationService>();
            //services.AddTransient<ITlevelLoader, TlevelLoader>();
            //services.AddTransient<IProviderLoader, ProviderLoader>();

            services.AddTransient <IBlobStorageService, BlobStorageService>();

            var lrsCertificate = CertificateService.GetLearningRecordServiceCertificate(ResultsAndCertificationConfiguration).GetAwaiter().GetResult();

            services.AddTransient <ILearnerPortTypeClient>(learnerClient =>
            {
                var client = new LearnerPortTypeClient();
                client.ClientCredentials.ClientCertificate.Certificate = lrsCertificate;
                return(client);
            });
            services.AddTransient <ILearnerServiceApiClient, LearnerServiceClient>();

            services.AddTransient <ILearnerServiceR9Client>(learnerClient =>
            {
                var client = new LearnerServiceR9Client();
                client.ClientCredentials.ClientCertificate.Certificate = lrsCertificate;
                return(client);
            });
            services.AddTransient <IPersonalLearningRecordApiClient, PersonalLearningRecordServiceClient>();
        }
        private void RegisterApiClients(IServiceCollection services)
        {
            var lrsCertificate = CertificateService.GetLearningRecordServiceCertificate(_configuration).GetAwaiter().GetResult();

            services.AddTransient <ILearnerServiceR9Client>(learnerClient =>
            {
                var client = new LearnerServiceR9Client();
                client.Endpoint.Address = CommonHelper.GetLrsEndpointAddress(_configuration.LearningRecordServiceSettings.BaseUri, ApiConstants.PlrServiceUri);
                client.ClientCredentials.ClientCertificate.Certificate = lrsCertificate;
                return(client);
            });
            services.AddTransient <IPersonalLearningRecordServiceApiClient, PersonalLearningRecordServiceApiClient>();

            services.AddTransient <ILearnerPortTypeClient>(learnerClient =>
            {
                var client = new LearnerPortTypeClient();
                client.Endpoint.Address = CommonHelper.GetLrsEndpointAddress(_configuration.LearningRecordServiceSettings.BaseUri, ApiConstants.LearnerServiceUri);
                client.ClientCredentials.ClientCertificate.Certificate = lrsCertificate;
                return(client);
            });
            services.AddTransient <ILearnerServiceApiClient, LearnerServiceApiClient>();
        }