private void ValidateSearchCriteria(bool globalReData, SearchCriteria criteria) { IList <string> validFilterParameters = new List <string>(); IList <string> validSortParameters = new List <string>(); if (globalReData) { validFilterParameters = _dealRepository.GetFilterParameters(); validSortParameters = _dealRepository.GetSortParameters(); } else { validFilterParameters = _workbenchDealsRepository.GetFilterParameters(); validSortParameters = _workbenchDealsRepository.GetSortParameters(); } criteria.ValidateSearchCriteria(validFilterParameters, validSortParameters); }