Class ExpressionExtensions
Helpers for rewriting and inspecting expression trees.
public static class ExpressionExtensions
- Inheritance
-
ExpressionExtensions
- Inherited Members
Methods
Has<T>(Expression)
Determines whether the expression tree contains a node of type T.
public static bool Has<T>(this Expression exp) where T : Expression
Parameters
expExpressionThe expression tree to search.
Returns
Type Parameters
TThe expression node type to look for.
Has<T>(Expression, out T?)
Determines whether the expression tree contains a node of type T and,
when it does, returns the first matching node through param.
public static bool Has<T>(this Expression exp, out T? param) where T : Expression
Parameters
expExpressionThe expression tree to search.
paramTThe first matching node, or
nullwhen none was found.
Returns
Type Parameters
TThe expression node type to look for.
NeedToConvert(Expression)
Determines whether the expression contains a special method call that requires an explicit conversion before it can be compared.
public static bool NeedToConvert(this Expression exp)
Parameters
expExpressionThe expression tree to inspect.