Parameter.SetBinding<T> Method (IEnumerable<T>, String, Rational, array<String[])

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

Binds the parameter to data.

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, _
    defaultValue As Rational, _
    ParamArray indexFields As String() _
)
public void SetBinding<T>(
    IEnumerable<T> binding,
    string valueField,
    Rational defaultValue,
    params string[] indexFields
)
public:
generic<typename T>
void SetBinding(
    IEnumerable<T>^ binding, 
    String^ valueField, 
    Rational defaultValue, 
    ... array<String^>^ indexFields
)
member SetBinding : 
        binding:IEnumerable<'T> * 
        valueField:string * 
        defaultValue:Rational * 
        indexFields:string[] -> unit 
JScript does not support generic types or methods.

Type Parameters

  • T

Parameters

  • valueField
    Type: System.String
    The name of the property of each input object that contains the value of the data element.
  • indexFields
    Type: array<System.String[]
    The names of the properties of each input object that contain the indexes of the data elements, one for each index set provided when the Parameter was created.

Exceptions

Exception Condition
InvalidModelDataException

A property or field is not found.

ArgumentNullException

ArgumentOutOfRangeException

Remarks

Each parameter must be bound before solving. The data must be in the form of a sequence of objects, where each object has properties for the value and index(es) of the data element.

The data is read each time Solve() is called.

.NET Framework Security

See Also

Reference

Parameter Class

SetBinding Overload

Microsoft.SolverFoundation.Services Namespace