Set.SetBinding<T> Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Binds the set to data. The data must be in the form of a sequence of objects, where each object has a property for the value for a set element. The data is read each time Context.Solve() is called.
Namespace: Microsoft.SolverFoundation.Services
Assembly: Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)
Syntax
'Declaration
Public Sub SetBinding(Of T) ( _
binding As IEnumerable(Of T), _
valueField As String _
)
public void SetBinding<T>(
IEnumerable<T> binding,
string valueField
)
public:
generic<typename T>
void SetBinding(
IEnumerable<T>^ binding,
String^ valueField
)
member SetBinding :
binding:IEnumerable<'T> *
valueField:string -> unit
JScript does not support generic types or methods.
Type Parameters
- T
The generic type.
Parameters
- binding
Type: System.Collections.Generic.IEnumerable<T>
A sequence of objects, one for each set element.
- valueField
Type: System.String
The name of the property of each input object which contains the value for a set element.
Exceptions
Exception | Condition |
---|---|
InvalidModelDataException | A property or field is not found. |
ArgumentNullException | |
ArgumentOutOfRangeException |
.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.