Ok, I had to dive into this one. Do you have any twin in your graph with a property LastUpdatedOn
or $lastUpdateTime
? Because no matter how I try, this does not seem to be the case when using BasicDigitalTwin
. The name also should be $lastUpdateTime
, because that's the name set on the property:
[JsonPropertyName(DigitalTwinsJsonPropertyNames.MetadataLastUpdateTime)]
public DateTimeOffset? LastUpdatedOn { get; internal set; }
But, when you dig further into where this is set (it's internal, can't be set by us), this happens in the BasicDigitalTwinJsonConverter
. But it's not set by looking at the twin itself, it's set by looping through all the twin's properties and copying the $lastUpdateTime
from the property's metadata.
My conclusion: this property LastUpdatedOn
is only set by the SDK and doesn't exist in the graph. That's why you can't query on the property.