コード例 #1
0
 public ExpressionFormatter(Func<string, Table> findTable)
 {
     _expressionFormatters = new Dictionary<SimpleExpressionType, Func<SimpleExpression, string>>
                                 {
                                     { SimpleExpressionType.And, LogicalExpressionToWhereClause },
                                     { SimpleExpressionType.Or, LogicalExpressionToWhereClause },
                                     { SimpleExpressionType.Equal, EqualExpressionToWhereClause },
                                     { SimpleExpressionType.NotEqual, NotEqualExpressionToWhereClause },
                                     {
                                         SimpleExpressionType.GreaterThan,
                                         expr => BinaryExpressionToWhereClause(expr, "gt")
                                         },
                                     {
                                         SimpleExpressionType.GreaterThanOrEqual,
                                         expr => BinaryExpressionToWhereClause(expr, "ge")
                                         },
                                     {
                                         SimpleExpressionType.LessThan,
                                         expr => BinaryExpressionToWhereClause(expr, "lt")
                                         },
                                     {
                                         SimpleExpressionType.LessThanOrEqual,
                                         expr => BinaryExpressionToWhereClause(expr, "le")
                                         },
                                     { SimpleExpressionType.Empty, expr => string.Empty },
                                 };
     _findTable = findTable;
     _simpleReferenceFormatter = new SimpleReferenceFormatter(findTable);
 }
コード例 #2
0
 public ExpressionFormatter(Func <string, Table> findTable)
 {
     _expressionFormatters = new Dictionary <SimpleExpressionType, Func <SimpleExpression, string> >
     {
         { SimpleExpressionType.And, LogicalExpressionToWhereClause },
         { SimpleExpressionType.Or, LogicalExpressionToWhereClause },
         { SimpleExpressionType.Equal, EqualExpressionToWhereClause },
         { SimpleExpressionType.NotEqual, NotEqualExpressionToWhereClause },
         {
             SimpleExpressionType.GreaterThan,
             expr => BinaryExpressionToWhereClause(expr, "gt")
         },
         {
             SimpleExpressionType.GreaterThanOrEqual,
             expr => BinaryExpressionToWhereClause(expr, "ge")
         },
         {
             SimpleExpressionType.LessThan,
             expr => BinaryExpressionToWhereClause(expr, "lt")
         },
         {
             SimpleExpressionType.LessThanOrEqual,
             expr => BinaryExpressionToWhereClause(expr, "le")
         },
         { SimpleExpressionType.Empty, expr => string.Empty },
     };
     _findTable = findTable;
     _simpleReferenceFormatter = new SimpleReferenceFormatter(findTable);
 }