Share via


DigitalTwinsClient.Query<T>(String, CancellationToken) Method

Definition

Queries for digital twins by iterating through a collection synchronously.

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

Type Parameters

T

The type to deserialize the result to.

Parameters

query
String

The query string, in SQL-like syntax.

cancellationToken
CancellationToken

The cancellation token.

Returns

The pageable list Pageable<T> of query results.

Exceptions

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

Examples

A basic query for all digital twins: SELECT * FROM digitalTwins.

Remarks

For more samples, see our repo samples. Note that there may be a delay between before changes in your instance are reflected in queries. For more details on query limitations, see Query limitations.

Applies to

See also