示例#1
0
        public List <IIssueModel> Search(IIssueSearchModel searchModel, bool asListing = false)
        {
            var results = IssuesRepository.Search(searchModel);

            return(asListing
                ? results.Select(IssueMapper.MapToModelListing).ToList()
                : results.Select(IssueMapper.MapToModelLite).ToList());
        }
 // ReSharper disable once ReturnTypeCanBeEnumerable.Local
 // ReSharper disable once SuggestBaseTypeForParameter
 private IQueryable <IIssue> SearchCommon(IIssueSearchModel searchModel, bool requireActive)
 {
     return(Context.Issues
            .FilterByBaseFilters(searchModel, requireActive)
            .FilterByNameableBaseFilters(searchModel)
            .FilterByHasStaffReview(searchModel.HasStaffReview)
            .FilterByPaging(searchModel.Paging));
 }
 public List<IIssueModel> Search(IIssueSearchModel searchModel, bool asListing = false)
 {
     var results = IssuesRepository.Search(searchModel);
     return asListing
         ? results.Select(IssueMapper.MapToModelListing).ToList()
         : results.Select(IssueMapper.MapToModelLite).ToList();
 }
 public IEnumerable <IIssue> Search(IIssueSearchModel searchModel, bool requireActive = true)
 {
     return(SearchCommon(searchModel, requireActive));
 }
 public IEnumerable <dynamic> Search(IIssueSearchModel searchModel, System.Func <IIssue, dynamic> selectStatement, bool requireActive = true)
 {
     return(SearchCommon(searchModel, requireActive)
            .Select(selectStatement));
 }
 // ReSharper disable once ReturnTypeCanBeEnumerable.Local
 // ReSharper disable once SuggestBaseTypeForParameter
 private IQueryable<IIssue> SearchCommon(IIssueSearchModel searchModel, bool requireActive)
 {
     return Context.Issues
         .FilterByBaseFilters(searchModel, requireActive)
         .FilterByNameableBaseFilters(searchModel)
         .FilterByHasStaffReview(searchModel.HasStaffReview)
         .FilterByPaging(searchModel.Paging);
 }
 public IEnumerable<IIssue> Search(IIssueSearchModel searchModel, bool requireActive = true)
 {
     return SearchCommon(searchModel, requireActive);
 }
 public IEnumerable<dynamic> Search(IIssueSearchModel searchModel, System.Func<IIssue, dynamic> selectStatement, bool requireActive = true)
 {
     return SearchCommon(searchModel, requireActive)
         .Select(selectStatement);
 }