Share via


DigitalTwinsClient.DeleteDigitalTwinAsync Method

Definition

Deletes a digital twin asynchronously.

public virtual System.Threading.Tasks.Task<Azure.Response> DeleteDigitalTwinAsync (string digitalTwinId, Azure.ETag? ifMatch = default, System.Threading.CancellationToken cancellationToken = default);
abstract member DeleteDigitalTwinAsync : string * Nullable<Azure.ETag> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
override this.DeleteDigitalTwinAsync : string * Nullable<Azure.ETag> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function DeleteDigitalTwinAsync (digitalTwinId As String, Optional ifMatch As Nullable(Of ETag) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response)

Parameters

digitalTwinId
String

The Id of the digital twin to delete.

ifMatch
Nullable<ETag>

Optional. Only perform the operation if the entity's ETag matches this optional ETag or * (All) is provided.

cancellationToken
CancellationToken

The cancellation token.

Returns

The HTTP response Response.

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 is null.

Examples

await client.DeleteDigitalTwinAsync(digitalTwinId);
Console.WriteLine($"Deleted digital twin '{digitalTwinId}'.");

Remarks

For more samples, see our repo samples.

Applies to