Ejemplo n.º 1
0
        public static string ExtractRootName(SqlCollectionExpression expression)
        {
            SqlRootNameExtractor extractor = new SqlRootNameExtractor();

            extractor.Visit(expression);
            return(extractor.rootName);
        }
        protected void Visit(SqlCollectionExpression expression)
        {
            switch (expression.Kind)
            {
            case SqlObjectKind.AliasedCollectionExpression:
                this.Visit(expression as SqlAliasedCollectionExpression);
                return;

            case SqlObjectKind.ArrayIteratorCollectionExpression:
                this.Visit(expression as SqlArrayIteratorCollectionExpression);
                return;

            case SqlObjectKind.JoinCollectionExpression:
                this.Visit(expression as SqlJoinCollectionExpression);
                return;

            case SqlObjectKind.SubqueryCollectionExpression:
                this.Visit(expression as SqlSubqueryCollectionExpression);
                return;

            default:
                throw new InvalidProgramException(
                          string.Format(CultureInfo.InvariantCulture, "Unexpected SqlObjectKind {0}", expression.Kind));
            }
        }
 private SqlJoinCollectionExpression(
     SqlCollectionExpression leftExpression,
     SqlCollectionExpression rightExpression)
     : base(SqlObjectKind.JoinCollectionExpression)
 {
     this.LeftExpression  = leftExpression;
     this.RightExpression = rightExpression;
 }
        private SqlFromClause(SqlCollectionExpression expression)
            : base(SqlObjectKind.FromClause)
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }

            this.Expression = expression;
        }
 public static SqlFromClause Create(SqlCollectionExpression expression)
 {
     return(new SqlFromClause(expression));
 }
 private SqlFromClause(SqlCollectionExpression expression)
 {
     this.Expression = expression ?? throw new ArgumentNullException(nameof(expression));
 }
 public static SqlFromClause Create(SqlCollectionExpression expression) => new SqlFromClause(expression);
 public static SqlJoinCollectionExpression Create(
     SqlCollectionExpression leftExpression,
     SqlCollectionExpression rightExpression)
 {
     return(new SqlJoinCollectionExpression(leftExpression, rightExpression));
 }