System.Linq.Expressions.SwitchCase.Update C# (CSharp) Метод

Update() публичный Метод

Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.
public Update ( IEnumerable testValues, Expression body ) : SwitchCase
testValues IEnumerable The property of the result.
body Expression The property of the result.
Результат SwitchCase
        public SwitchCase Update(IEnumerable<Expression> testValues, Expression body)
        {
            if (testValues == TestValues && body == Body)
            {
                return this;
            }
            return Expression.SwitchCase(body, testValues);
        }
    }

Usage Example

Пример #1
0
        /// <summary>
        ///     Visits the children of the <see cref="SwitchCase" />.
        /// </summary>
        /// <param name="node">The expression to visit.</param>
        /// <returns>
        ///     The modified expression, if it or any subexpression was modified;
        ///     otherwise, returns the original expression.
        /// </returns>
        protected virtual SwitchCase VisitSwitchCase(SwitchCase node)
        {
            if (node == null)
            {
                throw new ArgumentNullException(nameof(node));
            }

            return(node.Update(Visit(node.TestValues), Visit(node.Body)));
        }
All Usage Examples Of System.Linq.Expressions.SwitchCase::Update