Class AwaitExpression
Represents suspension point in the execution of the lambda function until the awaited task completes.
Inherited Members
Namespace: DotNext.Linq.Expressions
Assembly: DotNext.Metaprogramming.dll
Syntax
public sealed class AwaitExpression : CustomExpression
Constructors
View SourceAwaitExpression(Expression, bool)
Constructs await expression.
Declaration
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(Task))]
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(Task<>))]
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(ValueTask))]
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(ValueTask<>))]
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(TaskAwaiter))]
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(TaskAwaiter<>))]
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(ValueTaskAwaiter))]
[DynamicDependency(DynamicallyAccessedMemberTypes.PublicMethods, typeof(ValueTaskAwaiter<>))]
public AwaitExpression(Expression expression, bool configureAwait = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Expression | expression | An expression providing asynchronous result in the form or Task or any other TAP pattern. |
| bool | configureAwait | true to call ConfigureAwait(bool) with false argument. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Passed expression doesn't implement TAP pattern. |
Properties
View SourceType
Gets result type of asynchronous operation.
Declaration
public override Type Type { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Overrides
Methods
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
View SourceVisitChildren(ExpressionVisitor)
Visit children expressions.
Declaration
protected override AwaitExpression VisitChildren(ExpressionVisitor visitor)
Parameters
| Type | Name | Description |
|---|---|---|
| ExpressionVisitor | visitor | Expression visitor. |
Returns
| Type | Description |
|---|---|
| AwaitExpression | Potentially modified expression if one of children expressions is modified during visit. |