InstanceAnnotationCollection Class

Note: This API is now obsolete.

Represents an annotation to capture all of the custom instance annotations on an ODataAnnotatable. This class is now obsolete. Instead of using this class to read and write Instance Annotations, use the InstanceAnnotations property on the OData object model instance being annotated. For example, to serialize or deserialize custom annotations on an entry, use the InstanceAnnotations property on ODataEntry.

Inheritance Hierarchy

System.Object
  Microsoft.Data.OData.InstanceAnnotationCollection

Namespace:  Microsoft.Data.OData
Assembly:  Microsoft.Data.OData (in Microsoft.Data.OData.dll)

Syntax

'Declaration
<DefaultMemberAttribute("Item")> _
<ObsoleteAttribute("The InstanceAnnotationCollection class is deprecated, use the InstanceAnnotations property on objects that support instance annotations instead.")> _
Public NotInheritable Class InstanceAnnotationCollection _
    Implements IEnumerable(Of KeyValuePair(Of String, ODataValue)),  _
    IEnumerable
'Usage
Dim instance As InstanceAnnotationCollection
[DefaultMemberAttribute("Item")]
[ObsoleteAttribute("The InstanceAnnotationCollection class is deprecated, use the InstanceAnnotations property on objects that support instance annotations instead.")]
public sealed class InstanceAnnotationCollection : IEnumerable<KeyValuePair<string, ODataValue>>, 
    IEnumerable
[DefaultMemberAttribute(L"Item")]
[ObsoleteAttribute(L"The InstanceAnnotationCollection class is deprecated, use the InstanceAnnotations property on objects that support instance annotations instead.")]
public ref class InstanceAnnotationCollection sealed : IEnumerable<KeyValuePair<String^, ODataValue^>>, 
    IEnumerable
[<SealedAttribute>]
[<DefaultMemberAttribute("Item")>]
[<ObsoleteAttribute("The InstanceAnnotationCollection class is deprecated, use the InstanceAnnotations property on objects that support instance annotations instead.")>]
type InstanceAnnotationCollection =  
    class 
        interface IEnumerable<KeyValuePair<string, ODataValue>>
        interface IEnumerable 
    end
public final class InstanceAnnotationCollection implements IEnumerable<KeyValuePair<String, ODataValue>>, IEnumerable

The InstanceAnnotationCollection type exposes the following members.

Constructors

  Name Description
Public method InstanceAnnotationCollection Initializes a new instance of the InstanceAnnotationCollection class.

Top

Properties

  Name Description
Public property Count Gets the number of elements contained in the InstanceAnnotationCollection.
Public property Item Gets or sets the element with the specified key.

Top

Methods

  Name Description
Public method Add Adds an element with the provided key and value to the ICollection<T>.
Public method Clear Removes all items from the InstanceAnnotationCollection.
Public method ContainsKey Determines whether the ICollection<T> contains an element with the specified key.
Public method Equals (Inherited from Object.)
Public method GetEnumerator Returns an enumerator that iterates through the collection.
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Public method Remove Removes the element with the specified key from the ICollection<T>.
Public method ToString (Inherited from Object.)
Public method TryGetValue Gets the value associated with the specified key.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IEnumerable.GetEnumerator Gets an enumerator for this object.

Top

Remarks

Currently only ODataError, ODataEntry, and ODataFeed supports instance annotations. Additionally, instance annotations will only be serialized in Json.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Data.OData Namespace