Interface ICache
The cache interface used to store and recover the data used by the SDK.
Namespace: Microsoft.Graph.Communications.Client.Cache
Assembly: Microsoft.Graph.Communications.Client.dll
Syntax
public interface ICache
Methods
GetDataAsync<T>(IEnumerable<IGraphProperty>, String, CancellationToken)
Gets the serialized string of the data at the specified resource path asynchronously. Fetching data only happens in HA/DR scenarios, so could take longer.
Declaration
Task<string> GetDataAsync<T>(IEnumerable<IGraphProperty> properties, string resourcePath, CancellationToken cancellationToken = default(CancellationToken))
where T : Entity
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IGraphProperty> | properties | The properties. |
String | resourcePath | The resource path. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<String> | The recovered serialized data at the specified resource path. |
Type Parameters
Name | Description |
---|---|
T | The type of Entity to fetch. |
GetDataCollectionAsync<T>(IEnumerable<IGraphProperty>, String, CancellationToken)
Gets the resource paths for the children of the collection with the specified resource path asynchronously. Fetching data only happens in HA/DR scenarios, so could take longer.
Declaration
Task<IEnumerable<string>> GetDataCollectionAsync<T>(IEnumerable<IGraphProperty> properties, string resourcePath, CancellationToken cancellationToken = default(CancellationToken))
where T : Entity
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IGraphProperty> | properties | The properties. |
String | resourcePath | The resource path. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IEnumerable<String>> | The recovered collection or child resource paths. |
Type Parameters
Name | Description |
---|---|
T | The type of Entity contained in the collection. |
SetData(ChangeType, IResource, IEnumerable<IGraphProperty>, String, Lazy<String>)
Sets the data under the specified resource path. These should be short running operations, as they block notification callbacks.
Declaration
void SetData(ChangeType change, IResource resource, IEnumerable<IGraphProperty> properties, string resourcePath, Lazy<string> serializedData)
Parameters
Type | Name | Description |
---|---|---|
ChangeType | change | The type of change occuring. |
IResource | resource | The resource being serialized. |
IEnumerable<IGraphProperty> | properties | The properties. |
String | resourcePath | The resource path. |
Lazy<String> | serializedData | The serialized data lazy string. For performance reasons the string is only serialized when requested. |