Bagikan melalui


DigitalTwinsClient.GetEventRoutesAsync(CancellationToken) Method

Definition

. Lists the event routes in a digital twins instance by iterating through a collection asynchronously.

public virtual Azure.AsyncPageable<Azure.DigitalTwins.Core.DigitalTwinsEventRoute> GetEventRoutesAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member GetEventRoutesAsync : System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.DigitalTwins.Core.DigitalTwinsEventRoute>
override this.GetEventRoutesAsync : System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.DigitalTwins.Core.DigitalTwinsEventRoute>
Public Overridable Function GetEventRoutesAsync (Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of DigitalTwinsEventRoute)

Parameters

cancellationToken
CancellationToken

The cancellation token.

Returns

The pageable list AsyncPageable<T> of application/json event routes and the HTTP response.

Exceptions

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

Examples

AsyncPageable<DigitalTwinsEventRoute> response = client.GetEventRoutesAsync();
await foreach (DigitalTwinsEventRoute er in response)
{
    Console.WriteLine($"Event route '{er.Id}', endpoint name '{er.EndpointName}'");
}

Remarks

For more samples, see our repo samples.

Applies to

See also