コード例 #1
0
        public static Expression Quote(Expression expression, object hoistedLocals, object[] locals)
        {
            Debug.Assert(hoistedLocals != null && locals != null);
            var quoter = new ExpressionQuoter((HoistedLocals)hoistedLocals, locals);

            return(quoter.Visit(expression));
        }
コード例 #2
0
        /// <summary>
        ///     Quotes the provided expression tree.
        /// </summary>
        /// <param name="expression">The expression to quote.</param>
        /// <param name="hoistedLocals">The hoisted local state provided by the compiler.</param>
        /// <param name="locals">The actual hoisted local values.</param>
        /// <returns>The quoted expression.</returns>
        // [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)]
        public static Expression Quote(Expression expression, object hoistedLocals, object[] locals)
        {
            if (hoistedLocals == null)
            {
                throw new ArgumentNullException(nameof(hoistedLocals));
            }
            if (locals == null)
            {
                throw new ArgumentNullException(nameof(locals));
            }
            var quoter = new ExpressionQuoter((HoistedLocals)hoistedLocals, locals);

            return(quoter.Visit(expression));
        }
コード例 #3
0
        public static Expression Quote(Expression expression, object hoistedLocals, object[] locals)
        {
            ExpressionQuoter quoter = new ExpressionQuoter((HoistedLocals)hoistedLocals, locals);

            return(quoter.Visit(expression));
        }