Class InterpolationExpression
Represents string interpolation expression.
Inherited Members
Namespace: DotNext.Linq.Expressions
Assembly: DotNext.Metaprogramming.dll
Syntax
public sealed class InterpolationExpression : CustomExpression
Properties
View SourceArguments
Returns a collection that contains one or more objects to format.
Declaration
public IReadOnlyList<Expression> Arguments { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<Expression> |
Format
Gets formatting pattern.
Declaration
public string Format { get; }
Property Value
| Type | Description |
|---|---|
| string |
FormatProvider
Gets the format provider.
Declaration
public Expression FormatProvider { get; }
Property Value
| Type | Description |
|---|---|
| Expression |
Type
Gets type of this expression.
Declaration
public override Type Type { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Overrides
Remarks
May be string or FormattableString which is depends on factory method.
Methods
View SourceCreate(in InterpolatedStringExpressionHandler, Expression?)
Creates an expression representing the interpolated string.
Declaration
public static InterpolationExpression Create(in InterpolationExpression.InterpolatedStringExpressionHandler handler, Expression? formatProvider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| InterpolationExpression.InterpolatedStringExpressionHandler | handler | The interpolated string. |
| Expression | formatProvider | The expression of type IFormatProvider. |
Returns
| Type | Description |
|---|---|
| InterpolationExpression | The expression representing the interpolated string. |
FormattableString(FormattableString)
Returns string interpolation expression which produces instance of FormattableString class.
Declaration
public static InterpolationExpression FormattableString(FormattableString str)
Parameters
| Type | Name | Description |
|---|---|---|
| FormattableString | str | Formatting pattern and actual arguments. |
Returns
| Type | Description |
|---|---|
| InterpolationExpression | String interpolation expression. |
PlainString(FormattableString, Expression?)
Returns string interpolation expression which produces formatted string as string class.
Declaration
public static InterpolationExpression PlainString(FormattableString str, Expression? formatProvider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| FormattableString | str | Formatting pattern and actual arguments. |
| Expression | formatProvider | The expression of type IFormatProvider. |
Returns
| Type | Description |
|---|---|
| InterpolationExpression | String interpolation expression. |
Reduce()
Translates this expression into predefined set of expressions using Lowering technique.
Declaration
public override Expression Reduce()
Returns
| Type | Description |
|---|---|
| Expression | Translated expression. |