Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Model.If Method

Solver Foundation 3.0

[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)

public static Term If(
	Term condition,
	Term resultTrue,
	Term resultFalse
)

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.

ExceptionCondition
ArgumentException

The operation is not valid for the given inputs.

This is a trinary operation.

Show:
© 2015 Microsoft