Table of Contents

Class TwinCollection

Namespace
nanoFramework.Azure.Devices.Shared
Assembly
nanoFramework.Azure.Devices.Client.dll

Represents a collection of properties for Twin.

public class TwinCollection : IEnumerable
Inheritance
TwinCollection
Implements
Inherited Members
Extension Methods

Constructors

TwinCollection()

Creates an empty TwinCollection.

public TwinCollection()

TwinCollection(Hashtable)

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

public TwinCollection(Hashtable twin)

Parameters

twin Hashtable

The JSON hashtable.

TwinCollection(string)

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

public TwinCollection(string twinJson)

Parameters

twinJson string

JSON fragment containing the twin data.

Properties

Count

Gets the count of properties in the Collection.

public int Count { get; }

Property Value

int

this[string]

Property Indexer.

public object this[string propertyName] { get; set; }

Parameters

propertyName string

Name of the property to get.

Property Value

object

Value for the given property name.

Version

Gets the version of the TwinCollection.

public long Version { get; }

Property Value

long

Methods

Add(string, object)

Add a property.

public void Add(string property, object value)

Parameters

property string

The property to add.

value object

The value of the property.

Contains(string)

Determines whether the specified property is present.

public bool Contains(string propertyName)

Parameters

propertyName string

The property to locate.

Returns

bool

True if the specified property is present; otherwise, false.

GetEnumerator()

Returns an enumerator that iterates through a collection.

public IEnumerator GetEnumerator()

Returns

IEnumerator

An IEnumerator object that can be used to iterate through the collection.

ToJson()

Gets the TwinProperties as a JSON string.

public string ToJson()

Returns

string

JSON string

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Remarks

Available only in mscorlib build with support for System.Reflection.