DigitalTwinsClient.GetRelationship<T> Method

Definition

Gets a relationship on a digital twin synchronously.

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

Type Parameters

T

The type to deserialize the relationship to.

Parameters

digitalTwinId
System.String

The Id of the source digital twin.

relationshipId
System.String

The Id of the relationship to retrieve.

cancellationToken
System.Threading.CancellationToken

The cancellation token.

Returns

Response<T>

The deserialized application/json relationship corresponding to the provided relationshipId 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.

System.ArgumentNullException

The exception is thrown when digitalTwinId or relationshipId is null.

Remarks

For more samples, see our repo samples.

Applies to

See also