Пример #1
0
        public IList <T> Search(string q)
        {
            var searchStatements = _searchQueryParser.ParseQuery(q);
            var query            = _repository.Queryable();

            foreach (var searchStatement in searchStatements)
            {
                var queryModifier = _queryModifierFactory.GetModifier(searchStatement.Condition);
                query = queryModifier.ApplyStatementToQuery(searchStatement, query);
            }

            return(query.ToList());
        }
Пример #2
0
        public IList <T> Search(string q)
        {
            var searchStatements = _searchQueryParser.ParseQuery(q);
            var query            = Queryable.AsQueryable <T>(_context.GetSetOfType <T>());

            foreach (var searchStatement in searchStatements)
            {
                var queryModifier = _queryModifierFactory.GetModifier(searchStatement.Condition);
                query = queryModifier.ApplyStatementToQuery(searchStatement, query);
            }

            return(query.ToList());
        }