Interface IAzureDigitalTwinsProvider
- Namespace
- Scaleout.Modules.DigitalTwin.Abstractions
- Assembly
- Scaleout.Modules.DigitalTwin.Abstractions.dll
Defines the methods available to ScaleOut Digital Twins for interacting with corresponding Azure Digital Twins (ADT) instances.
public interface IAzureDigitalTwinsProvider
Properties
IsActive
Indicates whether the ADT provider is active and can be used.
bool IsActive { get; }
Property Value
Methods
GetInstanceAsync(string, string)
Returns a JSON-serialized digital twin instance with the Id instanceId, of
type modelName.
Task<string> GetInstanceAsync(string modelName, string instanceId)
Parameters
modelNamestringThe name of the digital twins model.
instanceIdstringThe digital twin instance Id.
Returns
Exceptions
- ArgumentNullException
modelNameorinstanceIdis empty or null.- PersistenceProviderException
Failed to obtain the twin instance for the specified
modelName.
GetInstanceIdsAsync(string)
Returns a list of digital twin instance identifiers associated with the specified modelName.
Task<List<string>> GetInstanceIdsAsync(string modelName)
Parameters
modelNamestringThe name of the digital twin model.
Returns
- Task<List<string>>
The list of digital twin instance identifiers that are associated with the specified
modelName.
Exceptions
- ArgumentNullException
modelNameis empty or null.- PersistenceProviderException
Failed to obtain the list of object instance identifiers for the specified
modelName.
GetPropertyAsync<T>(string, string, string)
Gets the value of a property from a digital twin identified by
instanceId and modelName.
Task<T> GetPropertyAsync<T>(string modelName, string instanceId, string propertyName)
Parameters
modelNamestringThe name of the digital twins model.
instanceIdstringDigital twin instance Id.
propertyNamestringName of the property.
Returns
- Task<T>
The current property's value.
Type Parameters
TType of the property.
GetPropertyListAsync(string)
Returns the list of digital twin's properties defined by the specified modelName.
Task<IEnumerable<(string propertyName, string propertyType)>> GetPropertyListAsync(string modelName)
Parameters
modelNamestringThe name of the digital twins model.
Returns
- Task<IEnumerable<(string propertyName, string propertyType)>>
List of digital twin's properties.
Exceptions
- ArgumentNullException
modelNameis empty or null.- PersistenceProviderException
Failed to build the list of properties for the specified
modelName.
UpdatePropertyAsync<T>(string, string, string, T)
Updates the value of a property on a digital twin identified by
instanceId and modelName.
Task UpdatePropertyAsync<T>(string modelName, string instanceId, string propertyName, T propertyValue)
Parameters
modelNamestringThe name of the digital twins model.
instanceIdstringDigital twin instance Id.
propertyNamestringName of the property.
propertyValueTProperty's new value.
Returns
Type Parameters
TType of the property.