Class WithExpression
Provides an expression refer to a single object or structure so that body can use a simplified syntax when accessing member of the object or structure.
Inherited Members
Namespace: DotNext.Linq.Expressions
Assembly: DotNext.Metaprogramming.dll
Syntax
public sealed class WithExpression : CustomExpression
Properties
| Edit this page View SourceBody
Gets body of the statement.
Declaration
public Expression Body { get; }
Property Value
Type | Description |
---|---|
Expression |
Type
Gets type of this expression.
Declaration
public override Type Type { get; }
Property Value
Type | Description |
---|---|
Type |
Overrides
| Edit this page View SourceVariable
The expression representing referred object inside of Body.
Declaration
public ParameterExpression Variable { get; }
Property Value
Type | Description |
---|---|
ParameterExpression |
Methods
| Edit this page View SourceCreate(Expression, Statement)
Creates a new instance of WithExpression.
Declaration
public static WithExpression Create(Expression obj, WithExpression.Statement body)
Parameters
Type | Name | Description |
---|---|---|
Expression | obj | The object to be referred inside of the body. |
WithExpression.Statement | body | The body of the expression. |
Returns
Type | Description |
---|---|
WithExpression | The constructed expression. |
Create(Expression, Expression)
Creates a new instance of WithExpression.
Declaration
public static WithExpression Create(Expression obj, Expression body)
Parameters
Type | Name | Description |
---|---|---|
Expression | obj | The object to be referred inside of the body. |
Expression | body | The body of the expression. |
Returns
Type | Description |
---|---|
WithExpression | The constructed expression. |
Reduce()
Translates this expression into predefined set of expressions using Lowering technique.
Declaration
public override Expression Reduce()
Returns
Type | Description |
---|---|
Expression | Translated expression. |
Overrides
| Edit this page View SourceUpdate(Expression)
Reconstructs WithExpression with a new body.
Declaration
public WithExpression Update(Expression body)
Parameters
Type | Name | Description |
---|---|---|
Expression | body | A new body to be placed into this expression. |
Returns
Type | Description |
---|---|
WithExpression | The expression updated with the given body. |