Class Pair<TKey, TValue>

A generic pair class.

Inheritance
System.Object
Pair<TKey, TValue>
Implements
System.IEquatable<Pair<TKey, TValue>>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.Core.Common
Assembly: Mediachase.Commerce.dll
Version: 10.8.0
Syntax
public class Pair<TKey, TValue> : IEquatable<Pair<TKey, TValue>> where TKey : IEquatable<TKey> where TValue : IEquatable<TValue>
Type Parameters
Name Description
TKey

The type of the key.

TValue

The type of the value.

Constructors

Pair(TKey, TValue)

Constructor

Declaration
public Pair(TKey key, TValue value)
Parameters
Type Name Description
TKey key

The key.

TValue value

The value.

Pair(Pair<TKey, TValue>)

Constructor

Declaration
public Pair(Pair<TKey, TValue> pair)
Parameters
Type Name Description
Pair<TKey, TValue> pair

Properties

Key

The key.

Declaration
public TKey Key { get; set; }
Property Value
Type Description
TKey

Value

The value.

Declaration
public TValue Value { get; set; }
Property Value
Type Description
TValue

Methods

Equals(Pair<TKey, TValue>)

Indicates whether the current object is equal to another object of the same type.

Declaration
public bool Equals(Pair<TKey, TValue> pair)
Parameters
Type Name Description
Pair<TKey, TValue> pair

The pair to compare.

Returns
Type Description
System.Boolean

True if the key and value identities are the same.

HasSameKey(Pair<TKey, TValue>)

Indicates whether the current object share its key with another object of the same type.

Declaration
public bool HasSameKey(Pair<TKey, TValue> pair)
Parameters
Type Name Description
Pair<TKey, TValue> pair

The pair with the key to compare.

Returns
Type Description
System.Boolean

True if the key identities are the same.

HasSameValue(Pair<TKey, TValue>)

Indicates whether the current object share its value with another object of the same type.

Declaration
public bool HasSameValue(Pair<TKey, TValue> pair)
Parameters
Type Name Description
Pair<TKey, TValue> pair

The pair with the value to compare.

Returns
Type Description
System.Boolean

True if the value identities are the same.

ToString()

Converts the key of the current pair to its equivalent System.String representation.

Declaration
public override string ToString()
Returns
Type Description
System.String

A String representation.

Overrides
System.Object.ToString()

Implements

System.IEquatable<T>