Class NullDataStore (1.60.0)

public class NullDataStore : IDataStore

A null datastore. Nothing is stored, nothing is retrievable.

Inheritance

object > NullDataStore

Implements

IDataStore

Namespace

GoogleApisUtilStore

Assembly

Google.Apis.dll

Constructors

NullDataStore()

public NullDataStore()

Construct a new null datastore, that stores nothing.

Methods

ClearAsync()

public Task ClearAsync()

Asynchronously clears all values in the data store.

Returns
TypeDescription
Task

DeleteAsync<T>(string)

public 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
NameDescription
keystring

The key to delete.

Returns
TypeDescription
Task
Type Parameter
NameDescription
T

The type to delete from the data store.

GetAsync<T>(string)

public Task<T> GetAsync<T>(string key)

Asynchronously returns the stored value for the given key or null if not found. This implementation of IDataStore will always return a completed task with a result of null.

Parameter
NameDescription
keystring

The key to retrieve its value.

Returns
TypeDescription
Task

Always null.

Type Parameter
NameDescription
T

The type to retrieve from the data store.

StoreAsync<T>(string, T)

public Task StoreAsync<T>(string key, T value)

Asynchronously stores the given value for the given key (replacing any existing value). This implementation of IDataStore does not store the value, and will not return it in future calls to GetAsync<T>(string).

Parameters
NameDescription
keystring

The key.

valueT

The value.

Returns
TypeDescription
Task

A task that completes immediately.

Type Parameter
NameDescription
T

The type to store in the data store.

Extension Method