C# Class MongoDB.Driver.Linq.ExpressionParameterReplacer

A class that replaces all occurences of one parameter with a different parameter.
Inheritance: ExpressionVisitor
Show file Open project: CloudMetal/mongo-csharp-driver Class Usage Examples

Public Methods

Method Description
ExpressionParameterReplacer ( System.Linq.Expressions.ParameterExpression fromParameter, Expression toExpression ) : System.Linq.Expressions

Initializes a new instance of the ExpressionParameterReplacer class.

ReplaceParameter ( Expression node, System.Linq.Expressions.ParameterExpression fromParameter, Expression toExpression ) : Expression

Replaces all occurences of one parameter with a different parameter.

Protected Methods

Method Description
VisitParameter ( System.Linq.Expressions.ParameterExpression node ) : Expression

Replaces the from parameter with the two parameter if it maches.

Method Details

ExpressionParameterReplacer() public method

Initializes a new instance of the ExpressionParameterReplacer class.
public ExpressionParameterReplacer ( System.Linq.Expressions.ParameterExpression fromParameter, Expression toExpression ) : System.Linq.Expressions
fromParameter System.Linq.Expressions.ParameterExpression The parameter to be replaced.
toExpression System.Linq.Expressions.Expression The expression that replaces the parameter.
return System.Linq.Expressions

ReplaceParameter() public static method

Replaces all occurences of one parameter with a different parameter.
public static ReplaceParameter ( Expression node, System.Linq.Expressions.ParameterExpression fromParameter, Expression toExpression ) : Expression
node System.Linq.Expressions.Expression The expression containing the parameter that should be replaced.
fromParameter System.Linq.Expressions.ParameterExpression The from parameter.
toExpression System.Linq.Expressions.Expression The expression that replaces the parameter.
return System.Linq.Expressions.Expression

VisitParameter() protected method

Replaces the from parameter with the two parameter if it maches.
protected VisitParameter ( System.Linq.Expressions.ParameterExpression node ) : Expression
node System.Linq.Expressions.ParameterExpression The node.
return System.Linq.Expressions.Expression