MetalamaAPI documentationAspect APIMetalama.​Framework.​Code.​Syntax­BuildersExpression­FactoryCapture
Open sandboxFocus

ExpressionFactory.Capture Method


Creates a compile-time object that represents a run-time expression, i.e. the syntax or code, and not the result itself. The returned IExpression can then be used in run-time C# code thanks to the Value property. This mechanism allows to generate expressions that depend on a compile-time control flow.

public static IExpression Capture(dynamic expression)
Type Name Description
Object expression

A run-time expression, possibly containing compile-time sub-expressions. The expression cannot be dynamic. If you have a dynamic expression, do not call this method, but cast the dynamic expression to IExpression.

Type Description
See Also