Ejemplo n.º 1
0
        public IQueryable <TEntity> ApplyFilter(Action <SearchProperty> expression)
        {
            SearchProperty searchProperty = new SearchProperty();
            IQueryable     query          = dbSet;

            expression(searchProperty);
            CriteriaOperator criteria = CriteriaOperator.Parse(searchProperty.FieldName + " " + searchProperty.Operand + " " + searchProperty.Search);

            if (CriteriaValidator.IsCriteriaOperatorValid(criteria))
            {
                query = query.MakeSelect(Converter, criteria).AppendWhere(Converter, criteria);
            }
            return(query as IQueryable <TEntity>);
        }
Ejemplo n.º 2
0
 internal ItemSearchController(IItemSearchRepository itemSearchRepo, ISearchConfiguration configuration, IServiceLogRepository serviceLogRepository) : base(serviceLogRepository)
 {
     _itemSearchRepository        = itemSearchRepo;
     _searchConfigurationProvider = new SearchConfigurationProvider(configuration);
     _criteriaValidator           = new CriteriaValidator();
 }