Delen via


TwinCollection Class

Definition

Represents a collection of properties for Twin

[Newtonsoft.Json.JsonConverter(typeof(Microsoft.Azure.Devices.Shared.TwinCollectionJsonConverter))]
public class TwinCollection : System.Collections.IEnumerable
[<Newtonsoft.Json.JsonConverter(typeof(Microsoft.Azure.Devices.Shared.TwinCollectionJsonConverter))>]
type TwinCollection = class
    interface IEnumerable
Public Class TwinCollection
Implements IEnumerable
Inheritance
TwinCollection
Attributes
Newtonsoft.Json.JsonConverterAttribute
Implements

Constructors

TwinCollection()

Creates instance of TwinCollection. Shouldn't use this constructor since _metadata is null and calling GetLastUpdated can result in NullReferenceException

TwinCollection(JObject, JObject)

Creates a TwinCollection using the given JSON fragments for the body and metadata.

TwinCollection(String)

Creates a TwinCollection using a JSON fragment as the body.

TwinCollection(String, String)

Creates a TwinCollection using the given JSON fragments for the body and metadata.

Properties

Count

Gets the count of properties in the Collection.

Item[String]

Property Indexer

Version

Gets the version of the TwinCollection

Methods

ClearAllMetadata()

Clears all metadata out of the twin collection as well as the base metadata object.

ClearMetadata()

Clears metadata out of the twin collection.

Contains(String)

Determines whether the specified property is present.

GetEnumerator()

Returns an enumerator that iterates through a collection.

GetLastUpdated()

Gets the LastUpdated time for this property

GetLastUpdatedVersion()

Gets the LastUpdatedVersion for this property.

GetMetadata()

Gets the Metadata for this property.

ToJson(Formatting)

Gets the TwinProperties as a JSON string.

ToString()

Returns a string that represents the current object.

Applies to