Method AddOrUpdate
AddOrUpdate<T>(string, T)
Adds a new variable or updates an existing variable with the specified value.
Declaration
void AddOrUpdate<T>(string variableName, T value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | variableName | The name of the variable. |
| T | value | The value of the variable. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the variable's value. |
AddOrUpdate<T>(string, T, Func<T, T>)
Adds a new variable or updates an existing variable with a value determined by the updater function.
Declaration
void AddOrUpdate<T>(string variableName, T value, Func<T, T> updater)
Parameters
| Type | Name | Description |
|---|---|---|
| string | variableName | The name of the variable. |
| T | value | The initial value to use if the variable does not exist. |
| Func<T, T> | updater | A function to calculate the new value based on the current value. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the variable's value. |