Open sandboxFocus

Class ExpressionBuilder

Allows to build a run-time expression by composing a string thanks to an underlying StringBuilder. Use the ToExpression() method to convert the ExpressionBuilder into a compile-time representation of the expression, or the ToValue(IExpressionBuilder) methods converts it to a dynamic expression that can be used in the C# code of the template.

Inheritance
ExpressionBuilder
Implements
Namespace: Metalama.Framework.Code.SyntaxBuilders
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public sealed class ExpressionBuilder : SyntaxBuilder, IExpressionBuilder

Constructors

Name Description
ExpressionBuilder()

Properties

Name Description
ExpressionType

Gets or sets the resulting type of the expression, if known. This value allows to generate simpler code.

IsReferenceable

Gets or sets a value indicating whether the expression can be used in ref or out situations.

Methods

Name Description
Clone()

Returns a clone of the current ExpressionBuilder.

ToExpression()

Creates a compile-time IExpression from the current ExpressionBuilder.

Extension Methods