Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct System.​Collections.​Generic.​KeyValuePair`2

Assembly: System.Runtime

Defines a key/value pair that can be set or retrieved.

Properties

public TKey
Key
Gets the key in the key/value pair.
public TValue
Value
Gets the value in the key/value pair.

Methods

public void
Deconstruct​(TKey& key, TValue& value)
public string
ToString​()
Returns A string representation of the <see cref="T:System.Collections.Generic.KeyValuePair`2" /> , which includes the string representations of the key and value.
Returns a string representation of the <see cref="T:System.Collections.Generic.KeyValuePair`2" /> , using the string representations of the key and value.
public bool
Equals​(object obj)
Inherited from ValueType
obj The object to compare with the current instance.
Returns <see langword="true" /> if <paramref name="obj" /> and this instance are the same type and represent the same value; otherwise, <see langword="false" /> .
Indicates whether this instance and a specified object are equal.
public int
GetHashCode​()
Inherited from ValueType
Returns A 32-bit signed integer that is the hash code for this instance.
Returns the hash code for this instance.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .