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
- name
Type: System.String
The name of the constraint.
- 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
- 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.