Beispiel #1
0
        public void Test1()
        {
            MockQuery query = new MockQuery();

            StringVisitor visitor = new StringVisitor(query);

            Expression ex = new WhereEqualsExpression(null, "Title", "title1");

            visitor.Visite(ex);

            Assert.AreEqual("Title = title1", query.ClauseText);
        }
Beispiel #2
0
 protected override void VisitWhereEquals(WhereEqualsExpression expression)
 {
     if (expression.FieldName.ToUpper() == "UUID")
     {
         if (expression.Value != null)
         {
             eqUUIDs.Add(expression.Value.ToString());
         }
     }
     else if (expression.FieldName.ToUpper() == "USERKEY")
     {
         if (expression.Value != null)
         {
             eqUserKeys.Add(expression.Value.ToString());
         }
     }
     else
     {
         var field = MakeValue(expression.FieldName);
         var value = MakeValue(expression.Value);
         whereClause.AppendFormat("(doc[{0}]=={1})", MakeValue(expression.FieldName), value);
         this.viewNameBuilder.AppendFormat("{0}_EQ_{1}", expression.FieldName, AsViewNameString(expression.Value));
     }
 }
Beispiel #3
0
 protected abstract void VisitWhereEquals(WhereEqualsExpression expression);