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 | |
---|---|---|
InstanceAnnotationCollection | Initializes a new instance of the InstanceAnnotationCollection class. |
Top
Properties
Name | Description | |
---|---|---|
Count | Gets the number of elements contained in the InstanceAnnotationCollection. | |
Item | Gets or sets the element with the specified key. |
Top
Methods
Name | Description | |
---|---|---|
Add | Adds an element with the provided key and value to the ICollection<T>. | |
Clear | Removes all items from the InstanceAnnotationCollection. | |
ContainsKey | Determines whether the ICollection<T> contains an element with the specified key. | |
Equals | (Inherited from Object.) | |
GetEnumerator | Returns an enumerator that iterates through the collection. | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
Remove | Removes the element with the specified key from the ICollection<T>. | |
ToString | (Inherited from Object.) | |
TryGetValue | Gets the value associated with the specified key. |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
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.