InstanceAnnotationCollection.Add Method
Adds an element with the provided key and value to the ICollection<T>.
Namespace: Microsoft.Data.OData
Assembly: Microsoft.Data.OData (in Microsoft.Data.OData.dll)
Syntax
'Declaration
Public Sub Add ( _
key As String, _
value As ODataValue _
)
'Usage
Dim instance As InstanceAnnotationCollection
Dim key As String
Dim value As ODataValue
instance.Add(key, value)
public void Add(
string key,
ODataValue value
)
public:
void Add(
String^ key,
ODataValue^ value
)
member Add :
key:string *
value:ODataValue -> unit
public function Add(
key : String,
value : ODataValue
)
Parameters
- key
Type: System.String
The object to use as the key of the element to add.
- value
Type: Microsoft.Data.OData.ODataValue
The object to use as the value of the element to add.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | key is null. |
ArgumentException | An element with the same key already exists in the ICollection<T>. |
NotSupportedException | The ICollection<T> is read-only. |