Model.AddConstraint Method (String, String)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Adds a constraint to a model by parsing an OML expression.

Namespace:  Microsoft.SolverFoundation.Services
Assembly:  Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)

Syntax

'Declaration
Public Function AddConstraint ( _
    name As String, _
    expression As String _
) As Constraint
public Constraint AddConstraint(
    string name,
    string expression
)
public:
Constraint^ AddConstraint(
    String^ name, 
    String^ expression
)
member AddConstraint : 
        name:string * 
        expression:string -> Constraint 
public function AddConstraint(
    name : String, 
    expression : String
) : Constraint

Parameters

  • expression
    Type: System.String
    The expression for the constraint.

Return Value

Type: Microsoft.SolverFoundation.Services.Constraint
A constraint for the model.

Exceptions

Exception Condition
ModelException

The model is not valid.

.NET Framework Security

See Also

Reference

Model Class

AddConstraint Overload

Microsoft.SolverFoundation.Services Namespace