C# Class Shaolinq.Persistence.Linq.SqlExpressionReplacer

Replaces an expression within an expression tree with another expression
Inheritance: SqlExpressionVisitor
Show file Open project: tumtumtum/Shaolinq Class Usage Examples

Public Methods

Method Description
Replace ( Expression expression, Expression searchFor, Expression replaceWith ) : Expression

Walks an expression; finds the searchFor expression and replaces it with replaceWith. Uses an object identity comparison to identify if searchFor and replaceWith are the same.

Replace ( Expression expression, Expression searchFor, Expression replaceWith, Comparison compareExpressions ) : Expression

Walks an expression; finds the searchFor expression and replaces it with replaceWith. Uses the provided Comparison{OBJECT_TYPE} to compare searchFor and replaceWith.

Replace ( Expression expression, Expression>.Func selector ) : Expression

Protected Methods

Method Description
Visit ( Expression expression ) : Expression

Private Methods

Method Description
SqlExpressionReplacer ( Expression searchFor, Expression replaceWith, Comparison compareExpressions ) : System
SqlExpressionReplacer ( Expression>.Func selector ) : System

Method Details

Replace() public static method

Walks an expression; finds the searchFor expression and replaces it with replaceWith. Uses an object identity comparison to identify if searchFor and replaceWith are the same.
public static Replace ( Expression expression, Expression searchFor, Expression replaceWith ) : Expression
expression System.Linq.Expressions.Expression The expression to look withib
searchFor System.Linq.Expressions.Expression The expression to look for
replaceWith System.Linq.Expressions.Expression The expression to replace with
return System.Linq.Expressions.Expression

Replace() public static method

Walks an expression; finds the searchFor expression and replaces it with replaceWith. Uses the provided Comparison{OBJECT_TYPE} to compare searchFor and replaceWith.
public static Replace ( Expression expression, Expression searchFor, Expression replaceWith, Comparison compareExpressions ) : Expression
expression System.Linq.Expressions.Expression The expression to look withib
searchFor System.Linq.Expressions.Expression The expression to look for
replaceWith System.Linq.Expressions.Expression The expression to replace with
compareExpressions Comparison A /// used to compare and
return System.Linq.Expressions.Expression

Replace() public static method

public static Replace ( Expression expression, Expression>.Func selector ) : Expression
expression System.Linq.Expressions.Expression
selector Expression>.Func
return System.Linq.Expressions.Expression

Visit() protected method

protected Visit ( Expression expression ) : Expression
expression System.Linq.Expressions.Expression
return System.Linq.Expressions.Expression