Ejemplo n.º 1
0
        public async Task <CustomerInfo> GetCustomerInfoAsync(string customerServiceUrl, int customerId)
        {
            var client = new CustomersClient(customerServiceUrl, _httpClientFactory.CreateClient());

            //if customer does not exist -> 404
            var customerInfo = await client.GetAsync(customerId);

            return(new CustomerInfo
            {
                Name = customerInfo.Name,
                Surname = customerInfo.Surname
            });
        }