internal virtual SqlNode VisitIncludeScope(SqlIncludeScope node) { node.Child = this.Visit(node.Child); return node; }
internal override SqlNode VisitIncludeScope(SqlIncludeScope scope) { return new SqlIncludeScope(this.Visit(scope.Child), scope.SourceExpression); }
/// <summary> /// Convert inner expression from C# expression to basic SQL Query. /// </summary> /// <param name="node">The expression to convert.</param> /// <returns>The converted SQL query.</returns> internal SqlNode ConvertOuter(Expression node) { this.dominatingExpression = node; this.outerNode = true; SqlNode retNode; if (typeof(ITable).IsAssignableFrom(node.Type)) { retNode = this.VisitSequence(node); } else { retNode = this.VisitInner(node); } if (retNode.NodeType == SqlNodeType.MethodCall) { // if a tree consists of a single method call expression only, that method // must be either a mapped stored procedure or a mapped function throw Error.InvalidMethodExecution(((SqlMethodCall)retNode).Method.Name); } // if after conversion the node is an expression, we must // wrap it in a select SqlExpression sqlExpression = retNode as SqlExpression; if (sqlExpression != null) { retNode = new SqlSelect(sqlExpression, null, this.dominatingExpression); } retNode = new SqlIncludeScope(retNode, this.dominatingExpression); return retNode; }
internal override SqlNode VisitIncludeScope(SqlIncludeScope scope) { this.alreadyIncluded = new HashSet<MetaType>(); try { return this.Visit(scope.Child); // Strip the include scope so SqlBinder will be idempotent. } finally { this.alreadyIncluded = null; } }
internal override SqlNode VisitIncludeScope(SqlIncludeScope scope) { return(new SqlIncludeScope(this.Visit(scope.Child), scope.SourceExpression)); }