Show / Hide Table of Contents

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.Store
Assembly: Google.Apis.Core.dll
Syntax
public interface IDataStore

Methods

ClearAsync()

Asynchronously clears all values in the data store.

Declaration
Task ClearAsync()
Returns
Type Description
System.Threading.Tasks.Task

DeleteAsync<T>(string)

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.

Declaration
Task DeleteAsync<T>(string key)
Parameters
Type Name Description
string key

The key to delete.

Returns
Type Description
System.Threading.Tasks.Task
Type Parameters
Name Description
T

The type to delete from the data store.

GetAsync<T>(string)

Asynchronously returns the stored value for the given key or null if not found.

Declaration
Task<T> GetAsync<T>(string key)
Parameters
Type Name Description
string key

The key to retrieve its value.

Returns
Type Description
System.Threading.Tasks.Task<TResult><T>

The stored object.

Type Parameters
Name Description
T

The type to retrieve from the data store.

StoreAsync<T>(string, T)

Asynchronously stores the given value for the given key (replacing any existing value).

Declaration
Task StoreAsync<T>(string key, T value)
Parameters
Type Name Description
string key

The key.

T value

The value to store.

Returns
Type Description
System.Threading.Tasks.Task
Type Parameters
Name Description
T

The type to store in the data store.

Extension Methods

Utilities.ThrowIfNull<T>(T, string)
In This Article
Back to top Generated by DocFX