Example #1
0
        /// <summary>
        /// Creates, inserts,  and returns a new <see cref="ILinqFromClause"/> defines
        /// the from clause by its range variable name and range source selector.
        /// </summary>
        /// <param name="rangeVariableName">The name of the range variable
        /// referenced in the expression.</param>
        /// <param name="rangeSelector">The <see cref="IExpression"/> which denotes where to
        /// find the range source.</param>
        /// <returns>An <see cref="ILinqFromClause"/> instance which
        /// defines the new clause.</returns>
        public ILinqFromClause From(string rangeVariableName, IExpression rangeSelector)
        {
            var result = new LinqFromClause(rangeVariableName, rangeSelector);

            base.baseList.Add(result);
            return(result);
        }
Example #2
0
        public void VisitLinqFromClause(LinqFromClause clause)
        {
            Formatter.StartNode(clause);

            Formatter.WriteKeyword("from");
            Formatter.WriteSpace();
            clause.VariableName.AcceptVisitor(this);
            Formatter.WriteSpace();
            Formatter.WriteKeyword("in");
            Formatter.WriteSpace();
            clause.DataSource.AcceptVisitor(this);

            Formatter.EndNode();
        }