Пример #1
0
        public SearchStatement ParseStatement(string[] splitStatement)
        {
            var searchStatement = new SearchStatement
            {
                Condition = splitStatement[0],
                Element   = splitStatement[1],
            };

            if (splitStatement.Count() == 3)
            {
                searchStatement.Value = splitStatement[2];
            }

            return(searchStatement);
        }
Пример #2
0
 public IQueryable <T> ApplyStatementToQuery <T>(SearchStatement statement, IQueryable <T> queryable)
 {
     return(queryable.Include(statement.Element));
 }
Пример #3
0
        public IQueryable <T> ApplyStatementToQuery <T>(SearchStatement statement, IQueryable <T> queryable)
        {
            int numberToSkip;

            return(int.TryParse(statement.Value, out numberToSkip) ? queryable.Skip(numberToSkip) : queryable);
        }