コード例 #1
0
        public IActionResult Get(int id)
        {
            var customer = _customerDatabase.GetById(id);

            if (customer == null)
            {
                return(NotFound());
            }
            var loyaltyCard = _loyaltyCardDatabase.GetByCustomerId(customer.Id);

            if (loyaltyCard == null)
            {
                return(Ok(customer));
            }
            customer.LoyaltyCard = loyaltyCard;
            return(Ok(customer));
        }