Table of Contents

Class ExpressionParameterByNameReplacer

Namespace
LfrlAnvil.Expressions
Assembly
LfrlAnvil.Core.dll

Represents an expression tree rewriter capable of replacing ParameterExpression nodes by their Name.

public class ExpressionParameterByNameReplacer : ExpressionVisitor
Inheritance
ExpressionParameterByNameReplacer
Inherited Members
Extension Methods

Remarks

Parameters without a name are ignored.

Constructors

ExpressionParameterByNameReplacer(IReadOnlyDictionary<string, Expression>)

Creates a new ExpressionParameterByNameReplacer instance.

public ExpressionParameterByNameReplacer(IReadOnlyDictionary<string, Expression> parametersToReplace)

Parameters

parametersToReplace IReadOnlyDictionary<string, Expression>

Collection of (parameter-name, replacement-node) entries.

Methods

Visit(Expression?)

Dispatches the expression to one of the more specialized visit methods in this class.

public override Expression? Visit(Expression? node)

Parameters

node Expression

The expression to visit.

Returns

Expression

The modified expression, if it or any subexpression was modified; otherwise, returns the original expression.