ParameterService

Implements a service to get and set parameter values.

Namespace:
KpokPatagon.Commons.Parameters
Type:
Class
Public:
Yes
Protected:
No
Sealed:
Yes
Abstract:
No
Implements:
KpokPatagon.Commons.Parameters.IParameterService

Constructors

ParameterService

Initializes a new instance of ParameterService.

Signature:
public Void ParameterService(parameterDataService, configurationService)
Parameters
Name Type Summary
parameterDataService ParameterDataService
configurationService IParameterConfigurationService

Methods

GetBoolean

Gets a parameter value as boolean.

Signature:
public Boolean GetBoolean(name)
Returns

The value of the parámeter as boolean.

Parameters
Name Type Summary
name String The name of the parameter to retrive it's value.
Exceptions
Type Summary
ArgumentNullOrEmptyException Thrown when name is null or empty.
ParameterDoesNotExistException Thrown when the specified parameter does not exists.
WrongParameterTypeException Thrown when the type of the parameter is not string.

GetBooleanAsync

Gets a parameter value as boolean.

Signature:
public Task GetBooleanAsync(name)
Returns

The value of the parámeter as boolean.

Parameters
Name Type Summary
name String The name of the parameter to retrive it's value.
Exceptions
Type Summary
ArgumentNullOrEmptyException Thrown when name is null or empty.
ParameterDoesNotExistException Thrown when the specified parameter does not exists.
WrongParameterTypeException Thrown when the type of the parameter is not string.

GetInteger

Gets a parameter value as an integer.

Signature:
public Int32 GetInteger(name)
Returns

The value of the parámeter as integer.

Parameters
Name Type Summary
name String The name of the parameter to retrive it's value.
Exceptions
Type Summary
ArgumentNullOrEmptyException Thrown when name is null or empty.
ParameterDoesNotExistException Thrown when the specified parameter does not exists.
WrongParameterTypeException Thrown when the type of the parameter is not string.

GetIntegerAsync

Gets a parameter value as an integer.

Signature:
public Task GetIntegerAsync(name)
Returns

The value of the parámeter as integer.

Parameters
Name Type Summary
name String The name of the parameter to retrive it's value.
Exceptions
Type Summary
ArgumentNullOrEmptyException Thrown when name is null or empty.
ParameterDoesNotExistException Thrown when the specified parameter does not exists.
WrongParameterTypeException Thrown when the type of the parameter is not string.

GetString

Gets a parameter value as a string.

Signature:
public String GetString(name)
Returns

The value of the parámeter as string.

Parameters
Name Type Summary
name String The name of the parameter to retrive it's value.
Exceptions
Type Summary
ArgumentNullOrEmptyException Thrown when name is null or empty.
ParameterDoesNotExistException Thrown when the specified parameter does not exists.
WrongParameterTypeException Thrown when the type of the parameter is not string.

GetStringAsync

Gets a parameter value as a string.

Signature:
public Task GetStringAsync(name)
Returns

The value of the parámeter as string.

Parameters
Name Type Summary
name String The name of the parameter to retrive it's value.
Exceptions
Type Summary
ArgumentNullOrEmptyException Thrown when name is null or empty.
ParameterDoesNotExistException Thrown when the specified parameter does not exists.
WrongParameterTypeException Thrown when the type of the parameter is not string.

LoadParametersTree

Returns a parameter tree as a DTO including the parameter values from the store is required.

Signature:
public ParameterTreeNodeDto LoadParametersTree(includeStoredValues)
Parameters
Name Type Summary
includeStoredValues Boolean Whether the values from the store must be included.

LoadParametersTree

Returns a parameter tree as a DTO including the parameter values from the store is required.

Signature:
public ParameterTreeNodeDto LoadParametersTree(groupName, includeStoredValues)
Returns

A tree of parameters or null if the specified group does not exists.

Parameters
Name Type Summary
groupName String Name of the group from where to start loading parameters.
includeStoredValues Boolean Whether the values from the store must be included.

LoadParametersTreeAsync

Returns a parameter tree as a DTO including the parameter values from the store is required.

Signature:
public Task LoadParametersTreeAsync(includeStoredValues)
Parameters
Name Type Summary
includeStoredValues Boolean Whether the values from the store must be included.

LoadParametersTreeAsync

Returns a parameter tree as a DTO including the parameter values from the store is required.

Signature:
public Task LoadParametersTreeAsync(groupName, includeStoredValues)
Returns

A tree of parameters or null if the specified group does not exists.

Parameters
Name Type Summary
groupName String Name of the group from where to start loading parameters.
includeStoredValues Boolean Whether the values from the store must be included.

SetValue

Sets the value of the parameter.

Signature:
public Void SetValue(name, value)
Parameters
Name Type Summary
name String The name of the parameter to set it's value.
value String The value to be set.
Exceptions
Type Summary
ArgumentNullOrEmptyException Thrown when name is null or empty.
ParameterDoesNotExistException Thrown when the specified parameter does not exists.
ParameterValueValidationException Thrown when the value is not valid.

SetValueAsync

Sets the value of the parameter.

Signature:
public Task SetValueAsync(name, value)
Parameters
Name Type Summary
name String The name of the parameter to set it's value.
value String The value to be set.
Exceptions
Type Summary
ArgumentNullOrEmptyException Thrown when name is null or empty.
ParameterDoesNotExistException Thrown when the specified parameter does not exists.
ParameterValueValidationException Thrown when the value is not valid.