コード例 #1
0
        public Customer[] GetAllCustomers()
        {
            Customer[] customers = CustomerRepository.LoadAllCustomers();
            foreach (Customer customer in customers)
            {
                customer.Orders = orderActions.GetOrdersForCustomer(customer.CustomerId);
            }

            return(customers);
        }
コード例 #2
0
ファイル: OrderService.cs プロジェクト: Motsosi/tech-test
        public List <Customer> LoadAllCustomersAndOrders()
        {
            try
            {
                List <Customer> customers = CustomerRepository.LoadAllCustomers();

                return(customers);
            }
            catch (Exception ex)
            {
                throw new Exception("Failed to load customers.", ex);
            }
        }