Properties.GetOrAdd Method
Definition
Gets the value of a single valued property with the specified key or returns a default value if the property does not exist.
public T GetOrAdd<T>(string key, Func<string, T> defaultCreator);
Type Parameters
Name | Description |
---|---|
T | The type of the property. |
Parameters
Name | Type | Description |
---|---|---|
key | The key of the property. | |
defaultCreator | Function to create the value to return if the property does not exist. |
Returns
T
The value of the property.
Last modified: 22 November 2024