Пример #1
0
        public async Task <Customer> GetCustomerById(string customerId)
        {
            Customer customer = _cache.GetCustomerById(customerId);

            if (customer != null)
            {
                return(customer);
            }

            customer = await _customersRepository.GetById(customerId);

            if (customer == null)
            {
                return(null);
            }

            _cache.SetCustomer(customer);

            return(customer);
        }