public virtual SearchCriteria MapToDomainModel(SearchFormViewModel viewModel)
        {
            SearchCriteria objSearchCriteria = new SearchCriteria
            {
                Skills = viewModel.SelectedSkills,
                ServiceAreas = viewModel.SelectedServiceAreas,
                City = viewModel.City,
                PostalCode = viewModel.PostalCode
            };

            return objSearchCriteria;
        }
 public virtual IEnumerable<BoardMemberSearchResult> GetBoardMemberSearchResultsFor(SearchCriteria searchCriteria)
 {
     using (var context = new SqlDataContext())
     {
         if (!string.IsNullOrEmpty(searchCriteria.State) && !string.IsNullOrEmpty(searchCriteria.City))
         {
             return context.BoardMemberSearchIndex.Where(x => x.State == searchCriteria.State && x.City == searchCriteria.City).ToList();
         }
         else if (!string.IsNullOrEmpty(searchCriteria.PostalCode))
         {
             return context.BoardMemberSearchIndex.Where(x => x.Zip == searchCriteria.PostalCode).ToList();
         }
         else
         {
             return context.BoardMemberSearchIndex.Take(10000).ToList();
         }
     }
 }
        public virtual SearchResult<int> GetBoardMemberSearchResultsFor(SearchCriteria searchCriteria, int page)
        {
            SearchResult<int> result = new SearchResult<int>
            {
                Page = page,
            };

            var interimResults = _repository.GetBoardMemberSearchResultsFor(searchCriteria);

            var searchValues = interimResults.AsParallel().Select(rawResult => new { Id = rawResult.BoardMemberId, Score = CreateScore(rawResult, searchCriteria) });

            result.MaxNumberOfPages = Math.Ceiling((double)searchValues.Count() / (double)_itemsPerPage);

            result.SearchIds = searchValues.GroupBy(x => x.Score)
                .OrderByDescending(x => x.Key)
                .Where(x => x.Key != 0)
                .SelectMany(x => x)
                //.Skip(_itemsPerPage * page)
                .Take(500)
                .Select(x => x.Id)
                .ToList();

            return result;
        }
 protected virtual int CreateScore(BoardMemberSearchResult result, SearchCriteria searchCriteria)
 {
     return _resultScorer.ScoreSearchCriteriaRelevance(result, searchCriteria.Skills, searchCriteria.ServiceAreas);
 }
        public virtual IEnumerable<BoardMember> GetMatchingBoardMembers(SearchCriteria criteria)
        {
            var objResults = new SearchResults();

            return null;
        }
        public virtual IEnumerable<Charity> GetMatchingCharities(SearchCriteria criteria)
        {
            var objResults = new SearchResults();

            return null;
        }