Interface ISharedData
- Namespace
- Scaleout.Modules.DigitalTwin.Abstractions
- Assembly
- Scaleout.Modules.DigitalTwin.Abstractions.dll
Provides access to objects that are shared between model instances.
public interface ISharedData
Methods
ClearAsync()
Clears all objects from the cache.
Task<ICacheResult> ClearAsync()
Returns
- Task<ICacheResult>
ICacheResult containing the outcome of the operation.
Remarks
The Status property of the returned result will contain the following CacheOperationStatus:
| Status | Description |
|---|---|
| CacheCleared | The shared data repository was successfully cleared. |
GetAsync(string)
Retrieves an existing object from the cache.
Task<ICacheResult> GetAsync(string key)
Parameters
keystringIdentifier of the object in the cache.
Returns
- Task<ICacheResult>
ICacheResult containing the outcome of the operation and the retrieved object (if successful).
Remarks
The Status property of the returned result will contain one of the following CacheOperationStatus outcomes:
| Status | Description |
|---|---|
| ObjectRetrieved | The object was successfully retrieved. |
| ObjectDoesNotExist | The requested object was not found. |
PutAsync(string, byte[])
Adds or updates an object in the cache.
Task<ICacheResult> PutAsync(string key, byte[] value)
Parameters
Returns
- Task<ICacheResult>
ICacheResult containing the outcome of the operation.
Remarks
The Status property of the returned result will contain the following CacheOperationStatus:
| Status | Description |
|---|---|
| ObjectPut | The object was successfully put into the shared data repository. |
RemoveAsync(string)
Removes an object from the cache.
Task<ICacheResult> RemoveAsync(string key)
Parameters
keystringIdentifier of the object in the cache.
Returns
- Task<ICacheResult>
ICacheResult containing the outcome of the operation.
Remarks
The Status property of the returned result will contain the following CacheOperationStatus:
| Status | Description |
|---|---|
| ObjectRemoved | The object was successfully removed from the shared data repository. |