Class DictionaryExtensions
Dictionary extension methods
Inherited Members
Namespace: PayrollEngine.Client.Scripting
Assembly: PayrollEngine.Client.Scripting.dll
Syntax
public static class DictionaryExtensions
Methods
View SourceGetValue(Dictionary<string, object>, string, object)
Get string/object dictionary value
Declaration
public static object GetValue(this Dictionary<string, object> dictionary, string key, object defaultValue = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<string, object> | dictionary | |
| string | key | The value key |
| object | defaultValue | The default value |
Returns
| Type | Description |
|---|---|
| object | The dictionary value |
GetValue<T>(Dictionary<string, object>, string, T)
Get string/T dictionary value
Declaration
public static T GetValue<T>(this Dictionary<string, object> dictionary, string key, T defaultValue = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<string, object> | dictionary | |
| string | key | The value key |
| T | defaultValue | The default value |
Returns
| Type | Description |
|---|---|
| T | The dictionary value |
Type Parameters
| Name | Description |
|---|---|
| T |
GetValue<T>(Dictionary<string, string>, string, string, T)
Get value from a string/JSON-string dictionary
Declaration
public static T GetValue<T>(this Dictionary<string, string> dictionary, string dictionaryKey, string objectKey, T defaultValue = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<string, string> | dictionary | The dictionary |
| string | dictionaryKey | The dictionary key |
| string | objectKey | The object key |
| T | defaultValue | The default value |
Returns
| Type | Description |
|---|---|
| T | The dictionary value |
Type Parameters
| Name | Description |
|---|---|
| T |