Interface IAppSettingStore
Defines the interface for a store that provides CRUD operations for application settings.
Namespace: DataWeb.Setting
Assembly: DataWeb.Core.dll
Syntax
public interface IAppSettingStore
Properties
Name
Gets the name of the store.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
string |
Methods
ExistsAsync(string, CancellationToken)
Determines whether an application setting with the specified name exists.
Declaration
Task<bool> ExistsAsync(string name, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the setting to check. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | true if the setting exists; otherwise, false. |
GetSettingAsync(string, CancellationToken)
Gets the value of an application setting with the specified name.
Declaration
Task<string> GetSettingAsync(string name, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the setting to retrieve. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<string> | The value of the setting. |
GetSettingsAsync(CancellationToken)
Gets all application settings.
Declaration
Task<IEnumerable<AppSetting>> GetSettingsAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<AppSetting>> | A collection of AppSetting objects. |
GetSettingsCachedAsync(CancellationToken)
Gets all application settings in cache.
Declaration
Task<IEnumerable<AppSetting>> GetSettingsCachedAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<AppSetting>> | A collection of AppSetting objects. |
RemoveAsync(string, CancellationToken)
Removes an application setting with the specified name.
Declaration
Task RemoveAsync(string name, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the setting to remove. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
SetAsync(string, string, CancellationToken)
Sets the value of an application setting with the specified name.
Declaration
Task SetAsync(string name, string value, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the setting to set. |
string | value | The value of the setting to set. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |