public static CompaniesUsersAddresses LoadFrom(ITableReader reader) { Company[] companies = null; User[] users = null; Address[] addresses = null; foreach (ITable table in reader.GetTables()) { switch (table.Name) { case "Companies": companies = new CompanyParser().GetAll(table).ToArray(); break; case "Users": users = new UserParser().GetAll(table).ToArray(); break; case "Addresses": addresses = new AddressParser().GetAll(table).ToArray(); break; } } return new CompaniesUsersAddresses(companies, users, addresses); }