/// <summary> /// Initializes a new instance of the <see cref="QueryConverter"/> class. /// </summary> /// <param name="services">The services.</param> /// <param name="typeProvider">The type provider.</param> /// <param name="translator">The translator.</param> /// <param name="nodeFactory">The node factory.</param> internal QueryConverter(IDataServices services, TypeSystemProvider typeProvider, Translator translator, NodeFactory nodeFactory) { if(services == null) { throw Error.ArgumentNull("services"); } if(nodeFactory == null) { throw Error.ArgumentNull("sql"); } if(translator == null) { throw Error.ArgumentNull("translator"); } if(typeProvider == null) { throw Error.ArgumentNull("typeProvider"); } _services = services; _translator = translator; _nodeFactory = nodeFactory; _typeProvider = typeProvider; _parameterExpressionToSqlExpression = new Dictionary<ParameterExpression, SqlExpression>(); _parameterExpressionToExpression = new Dictionary<ParameterExpression, Expression>(); _parameterExpressionToSqlNode = new Dictionary<ParameterExpression, SqlNode>(); _sqlNodeToGroupInfo = new Dictionary<SqlNode, GroupInfo>(); _allowDeferred = true; }
internal MultiSetMultiPlexer(SqlMultiplexerOptionType options, IEnumerable<SqlParameter> parentParameters, NodeFactory sqlFactory) { this.options = options; this.sql = sqlFactory; this.canJoin = true; this.isTopLevel = true; this.parentParameters = parentParameters; }
internal MemberAccessBinder(SqlBinder binder, Translator translator, SqlColumnizer columnizer, NodeFactory sqlFactory, MetaModel model, DataLoadOptions shape, bool canUseOuterApply) { this.binder = binder; this.translator = translator; this.columnizer = columnizer; this.sql = sqlFactory; this.typeProvider = sqlFactory.TypeProvider; this.expander = new SqlExpander(this.sql); this.aggregateChecker = new SqlAggregateChecker(); this.linkMap = new LinkOptimizationScope(null); this.outerAliasMap = new Dictionary<SqlAlias, SqlAlias>(); this.model = model; this.shape = shape; this.canUseOuterApply = canUseOuterApply; }
internal Translator(IDataServices services, NodeFactory sqlFactory, TypeSystemProvider typeProvider) { this.services = services; this.sql = sqlFactory; this.typeProvider = typeProvider; }
internal SqlMultiplexer(SqlMultiplexerOptionType options, IEnumerable<SqlParameter> parentParameters, NodeFactory sqlFactory) { this._multiSetMultiPlexor = new MultiSetMultiPlexer(options, parentParameters, sqlFactory); }
internal WhereClauseLifter(NodeFactory sql) { this.sql = sql; this.aggregateChecker = new SqlAggregateChecker(); this.rowNumberChecker = new SqlRowNumberChecker(); }
internal SqlReorderer(TypeSystemProvider typeProvider, NodeFactory sqlFactory) { this.typeProvider = typeProvider; this.sql = sqlFactory; }
internal Visitor(SqlNodeAnnotations annotations, NodeFactory sql) { this.annotations = annotations; this.sql = sql; }
internal static SqlNode Simplify(SqlNode node, NodeFactory sql) { return new CaseSimplifier(sql).Visit(node); }
internal ObjectExpressionFlattener(NodeFactory sql, SqlColumnizer columnizer) { this.sql = sql; this.columnizer = columnizer; this.isTopLevel = true; }
internal SqlTypeConverter(NodeFactory sql) { this.sql = sql; }
internal Booleanizer(NodeFactory factory) { this.sql = factory; }
internal static SqlNode Convert(SqlNode node, NodeFactory sql, MetaModel model) { return new Visitor(sql, model).Visit(node); }
internal Visitor(NodeFactory sql, MetaModel model) { this.sql = sql; this.model = model; }
internal CaseSimplifier(NodeFactory sql) { _sql = sql; }
internal TypeCorrector(NodeFactory factory) { this.sql = factory; this.typeProvider = factory.TypeProvider; }
internal SqlMethodTransformer(NodeFactory sql) { this.sql = sql; }
internal static SqlNode Reduce(SqlNode node, NodeFactory factory, SqlNodeAnnotations annotations) { Visitor r = new Visitor(factory, annotations); return r.Visit(node); }
internal SqlExpander(NodeFactory factory) { this.factory = factory; }
internal Visitor(NodeFactory factory, SqlNodeAnnotations annotations) { this.factory = factory; this.annotations = annotations; }
internal static SqlNode Reduce(SqlNode node, SqlNodeAnnotations annotations, NodeFactory sql) { return new Visitor(annotations, sql).Visit(node); }
internal ScalarSubQueryRewriter(NodeFactory sqlFactory) { this.sql = sqlFactory; this.aggregateChecker = new SqlAggregateChecker(); }
internal ExpressionDuplicator(NodeFactory factory) : base(true) { this.factory = factory; }
internal SqlRetyper(NodeFactory factory) { this.visitor = new TypeCorrector(factory); }
internal static SqlNode Lift(SqlNode node, NodeFactory factory) { return new WhereClauseLifter(factory).Visit(node); }
internal SqlBinder(Translator translator, NodeFactory sqlFactory, MetaModel model, DataLoadOptions shape, SqlColumnizer columnizer, bool canUseOuterApply) { this.sql = sqlFactory; this.columnizer = columnizer; this.visitor = new MemberAccessBinder(this, translator, this.columnizer, this.sql, model, shape, canUseOuterApply); }
internal OrderByLifter(TypeSystemProvider typeProvider, NodeFactory sqlFactory) { this.orders = new List<SqlOrderExpression>(); this.typeProvider = typeProvider; this.sql = sqlFactory; }
internal SqlFlattener(NodeFactory sql, SqlColumnizer columnizer) { this.visitor = new ObjectExpressionFlattener(sql, columnizer); }
internal SqlRewriteScalarSubqueries(NodeFactory sqlFactory) { this.visitor = new ScalarSubQueryRewriter(sqlFactory); }
internal static SqlNode Lift(SqlNode node, NodeFactory factory) { return(new WhereClauseLifter(factory).Visit(node)); }