Skip to content

Interface IConfigurationService

Namespace: Void.Proxy.Api.Configurations
Assembly: Void.Proxy.Api.dll

public interface IConfigurationService : IHostedService

Implements

IHostedService

Methods

GetAsync<TConfiguration>(CancellationToken)

Retrieves a configuration instance of type TConfiguration. The returned instance is fully self-managed: any changes made to the instance are automatically saved to disk, and any changes from disk are automatically loaded into the instance.

ValueTask<TConfiguration> GetAsync<TConfiguration>(CancellationToken cancellationToken = default) where TConfiguration : notnull

Parameters

cancellationToken CancellationToken

A token used to signal the cancellation of the asynchronous operation.

Returns

ValueTask<TConfiguration>

A that resolves to the requested configuration.

Type Parameters

TConfiguration

The type of configuration being retrieved. It must not be null.

GetAsync<TConfiguration>(string, CancellationToken)

Retrieves a configuration instance of type TConfiguration. The returned instance is fully self-managed: any changes made to the instance are automatically saved to disk, and any changes from disk are automatically loaded into the instance.

ValueTask<TConfiguration> GetAsync<TConfiguration>(string key, CancellationToken cancellationToken = default) where TConfiguration : notnull

Parameters

key string

Specifies the identifier for the configuration value to be fetched.

cancellationToken CancellationToken

A token used to signal the cancellation of the asynchronous operation.

Returns

ValueTask<TConfiguration>

A that resolves to the requested configuration.

Type Parameters

TConfiguration

The type of configuration being retrieved. It must not be null.