Пример #1
0
		/// <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;
		}
Пример #2
0
		internal MultiSetMultiPlexer(SqlMultiplexerOptionType options, IEnumerable<SqlParameter> parentParameters, NodeFactory sqlFactory)
		{
			this.options = options;
			this.sql = sqlFactory;
			this.canJoin = true;
			this.isTopLevel = true;
			this.parentParameters = parentParameters;
		}
Пример #3
0
		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;
		}
Пример #4
0
 internal Translator(IDataServices services, NodeFactory sqlFactory, TypeSystemProvider typeProvider) {
     this.services = services;
     this.sql = sqlFactory;
     this.typeProvider = typeProvider;
 }
Пример #5
0
		internal SqlMultiplexer(SqlMultiplexerOptionType options, IEnumerable<SqlParameter> parentParameters, NodeFactory sqlFactory)
		{
			this._multiSetMultiPlexor = new MultiSetMultiPlexer(options, parentParameters, sqlFactory);
		}
Пример #6
0
		internal WhereClauseLifter(NodeFactory sql)
		{
			this.sql = sql;
			this.aggregateChecker = new SqlAggregateChecker();
			this.rowNumberChecker = new SqlRowNumberChecker();
		}
Пример #7
0
		internal SqlReorderer(TypeSystemProvider typeProvider, NodeFactory sqlFactory)
		{
			this.typeProvider = typeProvider;
			this.sql = sqlFactory;
		}
Пример #8
0
			internal Visitor(SqlNodeAnnotations annotations, NodeFactory sql)
			{
				this.annotations = annotations;
				this.sql = sql;
			}
Пример #9
0
		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;
		}
Пример #11
0
		internal SqlTypeConverter(NodeFactory sql)
		{
			this.sql = sql;
		}
Пример #12
0
		internal Booleanizer(NodeFactory factory)
		{
			this.sql = factory;
		}
Пример #13
0
		internal static SqlNode Convert(SqlNode node, NodeFactory sql, MetaModel model)
		{
			return new Visitor(sql, model).Visit(node);
		}
Пример #14
0
			internal Visitor(NodeFactory sql, MetaModel model)
			{
				this.sql = sql;
				this.model = model;
			}
Пример #15
0
		internal CaseSimplifier(NodeFactory sql)
		{
			_sql = sql;
		}
Пример #16
0
		internal TypeCorrector(NodeFactory factory)
		{
			this.sql = factory;
			this.typeProvider = factory.TypeProvider;
		}
Пример #17
0
		internal SqlMethodTransformer(NodeFactory sql)
		{
			this.sql = sql;
		}
Пример #18
0
		internal static SqlNode Reduce(SqlNode node, NodeFactory factory, SqlNodeAnnotations annotations)
		{
			Visitor r = new Visitor(factory, annotations);
			return r.Visit(node);
		}
Пример #19
0
		internal SqlExpander(NodeFactory factory)
		{
			this.factory = factory;
		}
Пример #20
0
			internal Visitor(NodeFactory factory, SqlNodeAnnotations annotations)
			{
				this.factory = factory;
				this.annotations = annotations;
			}
Пример #21
0
		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();
		}
Пример #23
0
		internal ExpressionDuplicator(NodeFactory factory)
			: base(true)
		{
			this.factory = factory;
		}
Пример #24
0
		internal SqlRetyper(NodeFactory factory)
		{
			this.visitor = new TypeCorrector(factory);
		}
Пример #25
0
		internal static SqlNode Lift(SqlNode node, NodeFactory factory)
		{
			return new WhereClauseLifter(factory).Visit(node);
		}
Пример #26
0
 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);
 }
Пример #27
0
		internal OrderByLifter(TypeSystemProvider typeProvider, NodeFactory sqlFactory)
		{
			this.orders = new List<SqlOrderExpression>();
			this.typeProvider = typeProvider;
			this.sql = sqlFactory;
		}
Пример #28
0
		internal SqlFlattener(NodeFactory sql, SqlColumnizer columnizer)
		{
			this.visitor = new ObjectExpressionFlattener(sql, columnizer);
		}
		internal SqlRewriteScalarSubqueries(NodeFactory sqlFactory)
		{
			this.visitor = new ScalarSubQueryRewriter(sqlFactory);
		}
Пример #30
0
 internal static SqlNode Lift(SqlNode node, NodeFactory factory)
 {
     return(new WhereClauseLifter(factory).Visit(node));
 }