Пример #1
0
        public Customer[] GetAllCustomers()
        {
            Customer[] customers = CustomerRepository.LoadAllCustomers();
            foreach (Customer customer in customers)
            {
                customer.Orders = orderActions.GetOrdersForCustomer(customer.CustomerId);
            }

            return(customers);
        }
Пример #2
0
        public List <Customer> LoadAllCustomersAndOrders()
        {
            try
            {
                List <Customer> customers = CustomerRepository.LoadAllCustomers();

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