Пример #1
0
        public void Setup()
        {
            _configuration = new ConfigurationBuilder()
                             .AddUserSecrets <JwtTokenGenerator>()
                             .Build();

            _apiConsumerConfig = new ApiConsumerConfig(_configuration);
        }
Пример #2
0
        public void Setup()
        {
            _configuration = new ConfigurationBuilder()
                             .AddJsonFile("appsettings.json", optional: false)
                             .AddUserSecrets <ApiConsumerTests>()
                             .Build();

            _apiConsumerConfig = new ApiConsumerConfig(_configuration);
            _apiConsumer       = new ApiConsumer(_apiConsumerConfig);
        }
Пример #3
0
        public IActionResult Index()
        {
            var config      = new ApiConsumerConfig("https://localhost:5001/api");
            var apiConsumer = new ApiConsumer(config);

            var accounts  = apiConsumer.GetAccounts();
            var viewModel = new AccountViewModel
            {
                Accounts = AccountMapper.SDKToDomain(accounts)
            };

            return(View(viewModel));
        }
Пример #4
0
        public ApiConsumer(ApiConsumerConfig config)
        {
            _config = config;

            _restConsumer = new RestConsumer(_config.BaseUrl);
        }