Class ConditionalBuilder
Builder of conditional expression.
Inherited Members
Namespace: DotNext.Metaprogramming
Assembly: DotNext.Metaprogramming.dll
Syntax
public sealed class ConditionalBuilder : ExpressionBuilder<ConditionalExpression>, ISupplier<ConditionalExpression>, IFunctional<Func<ConditionalExpression>>
Methods
| Edit this page View SourceElse(Action)
Constructs negative branch of the conditional expression.
Declaration
public ConditionalBuilder Else(Action body)
Parameters
Type | Name | Description |
---|---|---|
Action | body | Branch builder. |
Returns
Type | Description |
---|---|
ConditionalBuilder | Conditional expression builder. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Attempts to call this method out of lexical scope. |
Else(Expression)
Constructs negative branch of the conditional expression.
Declaration
public ConditionalBuilder Else(Expression branch)
Parameters
Type | Name | Description |
---|---|---|
Expression | branch | An expression representing negative branch. |
Returns
Type | Description |
---|---|
ConditionalBuilder | Conditional expression builder. |
Then(Action)
Constructs positive branch of the conditional expression.
Declaration
public ConditionalBuilder Then(Action body)
Parameters
Type | Name | Description |
---|---|---|
Action | body | Branch builder. |
Returns
Type | Description |
---|---|
ConditionalBuilder | Conditional expression builder. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Attempts to call this method out of lexical scope. |
Then(Expression)
Constructs positive branch of the conditional expression.
Declaration
public ConditionalBuilder Then(Expression branch)
Parameters
Type | Name | Description |
---|---|---|
Expression | branch | An expression representing positive branch. |
Returns
Type | Description |
---|---|
ConditionalBuilder | Conditional expression builder. |