-
Book Overview & Buying
-
Table Of Contents
Hands-On Azure Digital Twins
By :
Querying can be done through a call with the Query API using the .NET SDK. The result, however, can differ from the query request. It is mainly determined by the SELECT specification. Here, you will see several different return scenarios:
Since the result can differ per query, it is somewhat difficult to write a method that can be reused. It completely depends on what result you want the query to give back. However, it also allows you to write your own classes, supporting the serialization of results backward and forward.
A result set is always based on the Pageable<> class. It is a collection of values that support iteration over multiple service requests.
We will start by creating a method supporting the SELECT * type of query. Open the DigitalTwinsManager class and add the following code:
public Pageable<BasicDigitalTwin> QueryDigitalTwins(string query)
{
Pageable<BasicDigitalTwin>...