예제 #1
0
 protected void ApplyFuncWhere(IQueryBuilder builder, QueryWhereType whereType, QueryBuilder.QueryFunction func)
 {
     if (whereType == QueryWhereType.And)
     {
         builder.And(func);
     }
     else if (whereType == QueryWhereType.Or)
     {
         builder.Or(func);
     }
     else if (whereType == QueryWhereType.AndNot)
     {
         builder.AndNot(func);
     }
     else if (whereType == QueryWhereType.OrNot)
     {
         builder.OrNot(func);
     }
     else
     {
         throw new InvalidOperationException("Unknown query where type");
     }
 }
예제 #2
0
 protected void ApplyColumnWhere(IQueryBuilder builder, QueryWhereType whereType, string column,
                                 Func <IComparisonQueryBuilder, IQueryBuilder> func)
 {
     if (whereType == QueryWhereType.And)
     {
         func(builder.And(column));
     }
     else if (whereType == QueryWhereType.Or)
     {
         func(builder.Or(column));
     }
     else if (whereType == QueryWhereType.AndNot)
     {
         builder.AndNot(builder => func(builder.Where(column)));
     }
     else if (whereType == QueryWhereType.OrNot)
     {
         builder.OrNot(builder => func(builder.Where(column)));
     }
     else
     {
         throw new InvalidOperationException("Unknown query where type");
     }
 }