Exemple #1
0
 public Criteria(string property, Condition condition, object value, SimpleSearchParser parser)
 {
     Property  = property;
     Condition = condition;
     Value     = value;
     _parser   = parser;
 }
Exemple #2
0
        /// <summary>
        /// Creates a list of advanced criteria to represent this query.
        /// </summary>
        /// <param name="parser">The parser.</param>
        public IEnumerable <Criteria> ToCriteria(SimpleSearchParser parser)
        {
            if (Where == null)
            {
                return(Enumerable.Empty <Criteria>());
            }

            var visitor = new SimpleSearchVisitor(parser);

            Where.Visit(visitor);
            return(visitor.Criteria);
        }
Exemple #3
0
 /// <summary>
 /// Add a condition to the <see cref="Where"/> clause using an <see cref="AndOperator"/>.
 /// </summary>
 /// <param name="prop">Definition of the property</param>
 /// <param name="value">Serialized query to parse</param>
 /// <param name="parser">Parser settings to use</param>
 /// <param name="condition">The condition operate to use (if specified)</param>
 public void AddCondition(IPropertyDefinition prop, string value, SimpleSearchParser parser, Condition condition = Condition.Undefined)
 {
     AddCondition(parser.Parse(this, prop, value, condition));
 }
 public SimpleSearchVisitor(SimpleSearchParser parser)
 {
     _parser = parser;
 }