Table of Contents

Class FetchOnceDataLoader<TValue>

Namespace
GreenDonut
Assembly
GreenDonut.dll

The FetchOnceDataLoader<TValue> fetches a single object and caches it.

public abstract class FetchOnceDataLoader<TValue> : CacheDataLoader<string, TValue>, IDataLoader<string, TValue>, IDataLoader, IDisposable

Type Parameters

TValue

A value type.

Inheritance
FetchOnceDataLoader<TValue>
Implements
Inherited Members
Extension Methods

Constructors

FetchOnceDataLoader(DataLoaderOptions?)

protected FetchOnceDataLoader(DataLoaderOptions? options = null)

Parameters

options DataLoaderOptions

Methods

LoadAsync(CancellationToken)

Loads a single value. This call may return a cached value or enqueues this single request for batching if enabled.

public Task<TValue> LoadAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

A cancellation token.

Returns

Task<TValue>

A single result which may contain a value or information about the error which may occurred during the call.

LoadSingleAsync(string, CancellationToken)

protected override sealed Task<TValue> LoadSingleAsync(string key, CancellationToken cancellationToken)

Parameters

key string
cancellationToken CancellationToken

Returns

Task<TValue>

LoadSingleAsync(CancellationToken)

protected abstract Task<TValue> LoadSingleAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task<TValue>