Class AsyncResultExpression
Represents return from asynchronous lambda function.
Inherited Members
Namespace: DotNext.Linq.Expressions
Assembly: DotNext.Metaprogramming.dll
Syntax
public sealed class AsyncResultExpression : CustomExpression
Remarks
This expression turns async state machine into final state.
Constructors
| Edit this page View SourceAsyncResultExpression(bool)
Constructs void return from asynchronous lambda function.
Declaration
public AsyncResultExpression(bool valueTask)
Parameters
Type | Name | Description |
---|---|---|
bool | valueTask |
AsyncResultExpression(Expression, bool)
Constructs non-void return from asynchronous lambda function.
Declaration
public AsyncResultExpression(Expression result, bool valueTask)
Parameters
Type | Name | Description |
---|---|---|
Expression | result | An expression representing result to be returned from asynchronous lambda function. |
bool | valueTask | true, to represent the result as ValueTask or ValueTask<TResult>. |
Properties
| Edit this page View SourceAsyncResult
An expression representing result to be returned from asynchronous lambda function.
Declaration
public Expression AsyncResult { get; }
Property Value
Type | Description |
---|---|
Expression |
Type
Type of this expression.
Declaration
public override Type Type { get; }
Property Value
Type | Description |
---|---|
Type |
Overrides
Remarks
The type of this expression is Task, Task<TResult>, ValueTask or ValueTask<TResult>.
Methods
| Edit this page View SourceReduce()
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 SourceVisitChildren(ExpressionVisitor)
Visit children expressions.
Declaration
protected override AsyncResultExpression VisitChildren(ExpressionVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
ExpressionVisitor | visitor | Expression visitor. |
Returns
Type | Description |
---|---|
AsyncResultExpression | Potentially modified expression if one of children expressions is modified during visit. |