Click or drag to resize
DictionaryExtensionsGetValueOrDefaultTKey, TValue Method (IDictionaryTKey, TValue, TKey, Boolean)
Returns the value associated with key in the dictionary. If not present, adds the default value to the dictionary and returns that value.

Namespace: Bio.Util
Assembly: Bio.Core (in Bio.Core.dll) Version: 2.0.0.1 (2.0.0.1)
Syntax
public static TValue GetValueOrDefault<TKey, TValue>(
	this IDictionary<TKey, TValue> dictionary,
	TKey key,
	bool insertIfMissing
)
where TValue : new()

Parameters

dictionary
Type: System.Collections.GenericIDictionaryTKey, TValue

[Missing <param name="dictionary"/> documentation for "M:Bio.Util.DictionaryExtensions.GetValueOrDefault``2(System.Collections.Generic.IDictionary{``0,``1},``0,System.Boolean)"]

key
Type: TKey

[Missing <param name="key"/> documentation for "M:Bio.Util.DictionaryExtensions.GetValueOrDefault``2(System.Collections.Generic.IDictionary{``0,``1},``0,System.Boolean)"]

insertIfMissing
Type: SystemBoolean

[Missing <param name="insertIfMissing"/> documentation for "M:Bio.Util.DictionaryExtensions.GetValueOrDefault``2(System.Collections.Generic.IDictionary{``0,``1},``0,System.Boolean)"]

Type Parameters

TKey

[Missing <typeparam name="TKey"/> documentation for "M:Bio.Util.DictionaryExtensions.GetValueOrDefault``2(System.Collections.Generic.IDictionary{``0,``1},``0,System.Boolean)"]

TValue

[Missing <typeparam name="TValue"/> documentation for "M:Bio.Util.DictionaryExtensions.GetValueOrDefault``2(System.Collections.Generic.IDictionary{``0,``1},``0,System.Boolean)"]

Return Value

Type: TValue

[Missing <returns> documentation for "M:Bio.Util.DictionaryExtensions.GetValueOrDefault``2(System.Collections.Generic.IDictionary{``0,``1},``0,System.Boolean)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IDictionaryTKey, TValue. 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