public virtual Tuple <int[], string[], string[]> Execute(int?filteredToYear = null, string filteredByMake = null) { int[] years = _manufacturerRepository.GetYears(); string[] makes = null; string[] models = null; if ((years != null) && (years.Length > 0)) { // If the user specified a year, then look up the makes. // Otherwise, use the makes from the first year in the list. int selectedYear = -1; if ((filteredToYear != null) && (_manufacturerRepository.IsValidYear(filteredToYear.Value))) { selectedYear = filteredToYear.Value; } makes = _manufacturerRepository.GetMakes(selectedYear); // if the user specified a year and a make, then look up the models. if ((makes != null) && (makes.Length > 0)) { string selectedMake = string.Empty; if ((!string.IsNullOrEmpty(filteredByMake)) && (_manufacturerRepository.IsValidMake(selectedYear, filteredByMake))) { selectedMake = filteredByMake; } models = _manufacturerRepository.GetModels(selectedYear, selectedMake); } } if (years == null) { years = new int[] {}; } if (makes == null) { makes = new string[] {}; } if (models == null) { models = new string[] {}; } return(new Tuple <int[], string[], string[]>(years, makes, models)); }