Bagikan melalui


DigitalTwinsClient.GetComponent<T> Method

Definition

Gets a component on a digital twin synchronously.

public virtual Azure.Response<T> GetComponent<T> (string digitalTwinId, string componentName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetComponent : string * string * System.Threading.CancellationToken -> Azure.Response<'T>
override this.GetComponent : string * string * System.Threading.CancellationToken -> Azure.Response<'T>
Public Overridable Function GetComponent(Of T) (digitalTwinId As String, componentName As String, Optional cancellationToken As CancellationToken = Nothing) As Response(Of T)

Type Parameters

T

The type to deserialize the component to.

Parameters

digitalTwinId
String

The Id of the digital twin.

componentName
String

The component being retrieved.

cancellationToken
CancellationToken

The cancellation token.

Returns

The deserialized object representation of the component corresponding to the provided componentName and the HTTP response Response<T>.

Exceptions

The exception that captures the errors from the service. Check the ErrorCode and Status properties for more details.

The exception is thrown when digitalTwinId or componentName is null.

Remarks

For more samples, see our repo samples.

Applies to

See also