Interface IParameters
Wraps the passing fields and parameters for a page and supplies conversion to a fixed number of types.
Namespace: Softadmin.Api
Assembly: Softadmin.Api.dll
Syntax
public interface IParameters
Methods
GetBool(String)
Gets the value of a field as a boolean value.
Declaration
bool GetBool(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name, case insensitive. |
Returns
Type | Description |
---|---|
System.Boolean | The value of the field, converted to a boolean if necessary. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | No field found with the given name. |
System.InvalidCastException | The value could not be converted to a boolean. |
GetInt(String)
Gets the value of a field as an integer value.
Declaration
int GetInt(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name, case insensitive. |
Returns
Type | Description |
---|---|
System.Int32 | The value of the field, converted to an integer if necessary. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | No field found with the given name. |
System.InvalidCastException | The value could not be converted to an integer. |
GetString(String)
Gets the value of a field as a string value.
Declaration
string GetString(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name, case insensitive. |
Returns
Type | Description |
---|---|
System.String | The value of the field, converted to a string if necessary. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | No field found with the given name. |
TryGetBool(String, out Boolean)
Gets the value of a field as a boolean value.
Declaration
bool TryGetBool(string name, out bool value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name, case insensitive. |
System.Boolean | value | The value of the field, converted to a boolean if necessary. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryGetInt(String, out Int32)
Gets the value of a field as an integer value.
Declaration
bool TryGetInt(string name, out int value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name, case insensitive. |
System.Int32 | value | The value of the field, converted to an integer if necessary. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryGetString(String, out String)
Gets the value of a field as a string value.
Declaration
bool TryGetString(string name, out string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name, case insensitive. |
System.String | value | The value of the field, converted to a string if necessary. |
Returns
Type | Description |
---|---|
System.Boolean |
|