[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Ensures that a user variable with the given key is in the model.
Assembly: Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)
Return ValueType: System.Boolean
True if added successfully, otherwise false.
If the model already includes a user variable referenced by key, this sets the vid to the variable’s index and returns false. If the model already includes a row referenced by key, sets vid to -1 and returns false. Otherwise, it adds a new user variable associated with key to the model, assigns the next available index to the new variable, sets vid to this index, and returns true. By convention variables get indexes from 1 to VariableCount in the order they were added.
- 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.