public Customer[] ListCustomers(Transaction context) { var customers = new HashSet <Customer>(); if (Flights != null) { foreach (Customer c in Flights.ListCustomers(context)) { customers.Add(c); } } if (Cars != null) { foreach (Customer c in Cars.ListCustomers(context)) { customers.Add(c); } } if (Rooms != null) { foreach (Customer c in Rooms.ListCustomers(context)) { customers.Add(c); } } var cs = new Customer[customers.Count]; customers.CopyTo(cs); return(cs); }