 | ensureValueEnsureValueT, G Method |
Namespace:
WhetStone.Looping
Assembly:
WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntaxpublic static bool EnsureValue<T, G>(
this IDictionary<T, G> this,
T key,
G defaultval = null
)
Parameters
- this
- Type: System.Collections.GenericIDictionaryT, G
The IDictionaryTKey, TValue to ensure a value on. - key
- Type: T
The key to ensure value for. - defaultval (Optional)
- Type: G
The value to set to the key if none exists?
Type Parameters
- T
- The type of key of the IDictionaryTKey, TValue.
- G
- The type of value of the IDictionaryTKey, TValue.
Return Value
Type:
BooleanWhether a value existed before the method was called.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IDictionaryT,
G. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also