static void Init(CommandLineOptions options)
        {
            _httpSpiExecutionContextManager = new HttpSpiExecutionContextManager();
            _httpSpiExecutionContextManager.SetInternalRequestId(Guid.NewGuid());

            _providerRepository = new TableProviderRepository(
                new CacheConfiguration
            {
                TableStorageConnectionString = options.TableStorageConnectionString,
                ProviderTableName            = options.ProviderTableName,
            },
                _logger);

            var translator = new TranslatorApiClient(
                new AuthenticationConfiguration()
            {
                ClientId      = options.ClientId,
                ClientSecret  = options.ClientSecret,
                Resource      = options.Resource,
                TokenEndpoint = options.TokenEndpoint,
            },
                new RestClient(),
                new CacheProvider(),
                new TranslatorConfiguration
            {
                BaseUrl         = options.TranslatorBaseUrl,
                SubscriptionKey = options.TranslatorSubscriptionKey,
            },
                _logger,
                _httpSpiExecutionContextManager);

            _mapper = new PocoMapper(translator);
        }
Exemplo n.º 2
0
        static void Init(CommandLineOptions options)
        {
            _giasApiClient = new GiasSoapApiClient(new GiasApiConfiguration
            {
                Url       = options.GiasUrl,
                Username  = options.GiasUsername,
                Password  = options.GiasPassword,
                ExtractId = options.GiasExtractId,
                ExtractEstablishmentsFileName = "Eapim_Daily_Download.csv",
                ExtractGroupsFileName         = "groups.csv",
                ExtractGroupLinksFileName     = "groupLinks.csv",
            });

            _httpSpiExecutionContextManager = new HttpSpiExecutionContextManager();
            _httpSpiExecutionContextManager.SetInternalRequestId(Guid.NewGuid());

            var translator = new TranslatorApiClient(
                new AuthenticationConfiguration()
            {
                ClientId      = options.ClientId,
                ClientSecret  = options.ClientSecret,
                Resource      = options.Resource,
                TokenEndpoint = options.TokenEndpoint,
            },
                new RestClient(),
                new CacheProvider(),
                _httpSpiExecutionContextManager,
                new TranslatorConfiguration
            {
                BaseUrl         = options.TranslatorBaseUrl,
                SubscriptionKey = options.TranslatorSubscriptionKey,
            },
                _logger);

            _groupRepository = new InProcGroupRepository();

            _localAuthorityRepository = new InProcLocalAuthorityRepository();

            _mapper = new PocoMapper(translator, _groupRepository, _localAuthorityRepository);
        }
        static void Init(CommandLineOptions options)
        {
            _ukrlpApiClient = new UkrlpSoapApiClient(
                new RestClient(),
                new UkrlpApiConfiguration
            {
                Url           = options.UkrlpUrl,
                StakeholderId = options.UkrlpStakeholderId,
            });

            _httpSpiExecutionContextManager = new HttpSpiExecutionContextManager();
            _httpSpiExecutionContextManager.SetInternalRequestId(Guid.NewGuid());

            _providerRepository = new TableProviderRepository(
                new CacheConfiguration
            {
                TableStorageConnectionString = options.TableStorageConnectionString,
                ProviderTableName            = options.ProviderTableName,
                StateTableName = options.StateTableName,
            },
                _logger);
        }
 public void Arrange()
 {
     this.httpSpiExecutionContextManager =
         new HttpSpiExecutionContextManager();
 }