Assuming I want to load Device information using Microsoft.Azure.Devices package/SDK, does is make any difference which I call:
RegistryManager regManager = RegistryManager.CreateFromConnectionString(connectionString);
Device device = await regManager.GetDeviceAsync("Device_1");
// OR
Twin twin = (await regManager.CreateQuery("SELECT * FROM devices WHERE deviceId = 'Device_1'")
.GetNextAsTwinAsync())
.First();
Both Device
and Twin
seem to share most properties. Twin
is more generic and can be used to query Modules and can be used to read Tags, Desired/Reported properties. But other than that they seem to have more or less the same information, unless I'm missing something.
So I'm just wondering, are there any underlying differences or are the two basically the same?