public interface IDataStore
Stores and manages data objects, where the key is a string and the value is an object.
null
keys are not allowed.
Namespace
Google.Apis.Util.StoreAssembly
Google.Apis.Core.dll
Methods
ClearAsync()
Task ClearAsync()
Asynchronously clears all values in the data store.
Returns | |
---|---|
Type | Description |
Task |
DeleteAsync<T>(String)
Task DeleteAsync<T>(string key)
Asynchronously deletes the given key. The type is provided here as well because the "real" saved key should contain type information as well, so the data store will be able to store the same key for different types.
Parameter | |
---|---|
Name | Description |
key | String The key to delete. |
Returns | |
---|---|
Type | Description |
Task |
Type Parameter | |
---|---|
Name | Description |
T | The type to delete from the data store. |
GetAsync<T>(String)
Task<T> GetAsync<T>(string key)
Asynchronously returns the stored value for the given key or null
if not found.
Parameter | |
---|---|
Name | Description |
key | String The key to retrieve its value. |
Returns | |
---|---|
Type | Description |
Task<T> | The stored object. |
Type Parameter | |
---|---|
Name | Description |
T | The type to retrieve from the data store. |
StoreAsync<T>(String, T)
Task StoreAsync<T>(string key, T value)
Asynchronously stores the given value for the given key (replacing any existing value).
Parameters | |
---|---|
Name | Description |
key | String The key. |
value | T The value to store. |
Returns | |
---|---|
Type | Description |
Task |
Type Parameter | |
---|---|
Name | Description |
T | The type to store in the data store. |