Model.If Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Returns the second or third argument, depending on whether the condition is true.
Namespace: Microsoft.SolverFoundation.Services
Assembly: Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)
Syntax
'Declaration
Public Shared Function If ( _
condition As Term, _
resultTrue As Term, _
resultFalse As Term _
) As Term
public static Term If(
Term condition,
Term resultTrue,
Term resultFalse
)
public:
static Term^ If(
Term^ condition,
Term^ resultTrue,
Term^ resultFalse
)
static member If :
condition:Term *
resultTrue:Term *
resultFalse:Term -> Term
public static function If(
condition : Term,
resultTrue : Term,
resultFalse : Term
) : Term
Parameters
- condition
Type: Microsoft.SolverFoundation.Services.Term
The condition that determines which argument is returned.
- resultTrue
Type: Microsoft.SolverFoundation.Services.Term
The evaluation result when the condition is true.
- resultFalse
Type: Microsoft.SolverFoundation.Services.Term
The evaluation result when the condition is false.
Return Value
Type: Microsoft.SolverFoundation.Services.Term
The second input is returned if condition is true; otherwise, the third input is returned.
Exceptions
Exception | Condition |
---|---|
ArgumentException | The operation is not valid for the given inputs. |
Remarks
This is a trinary operation.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.