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); }
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); }