public Customer[] GetAllCustomers() { Customer[] customers = CustomerRepository.LoadAllCustomers(); foreach (Customer customer in customers) { customer.Orders = orderActions.GetOrdersForCustomer(customer.CustomerId); } return(customers); }
public List <Customer> LoadAllCustomersAndOrders() { try { List <Customer> customers = CustomerRepository.LoadAllCustomers(); return(customers); } catch (Exception ex) { throw new Exception("Failed to load customers.", ex); } }