Class AppSettingService
Provides methods for managing application settings.
Inheritance
object
AppSettingService
Implements
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DataWeb.Setting
Assembly: DataWeb.Core.dll
Syntax
public class AppSettingService : IAppSettingService
Constructors
AppSettingService(IAppSettingStore)
Initializes a new instance of the AppSettingService class.
Declaration
public AppSettingService(IAppSettingStore appSettingStore)
Parameters
Type | Name | Description |
---|---|---|
IAppSettingStore | appSettingStore | An instance of the IAppSettingStore interface. |
Methods
ExistsAsync(string)
Checks whether an application setting with the specified name exists.
Declaration
public Task<bool> ExistsAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the setting to check. |
Returns
Type | Description |
---|---|
Task<bool> | True if the setting exists, otherwise false. |
GetSettingAsync(string)
Retrieves the value of the application setting with the specified name.
Declaration
public Task<string> GetSettingAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the setting. |
Returns
Type | Description |
---|---|
Task<string> | The value of the setting as a string. |
GetSettingsAsync()
Retrieves all application settings.
Declaration
public Task<IEnumerable<AppSetting>> GetSettingsAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<AppSetting>> | A collection of AppSetting objects. |
RemoveAsync(string)
Removes the application setting with the specified name.
Declaration
public Task RemoveAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the setting to remove. |
Returns
Type | Description |
---|---|
Task |
SetAsync(string, string)
Sets the value of an application setting with the specified name.
Declaration
public Task SetAsync(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the setting to set. |
string | value | The value to set the setting to. |
Returns
Type | Description |
---|---|
Task |