Class Extensions
Extends some ineditable types "overloading" their Equals, GetHashCode and ToString methods.
Inherited Members
Namespace: Xareus.Relations.Utilities
Assembly: Xareus.Relations.dll
Syntax
public static class Extensions
Methods
EqualsExtension<E>(HashSet<E>, HashSet<E>)
Compares two hashSets for equality.
Declaration
public static bool EqualsExtension<E>(this HashSet<E> hashSet, HashSet<E> otherHashSet)
Parameters
Type | Name | Description |
---|---|---|
HashSet<E> | hashSet | The first hashSet |
HashSet<E> | otherHashSet | The second hashSet |
Returns
Type | Description |
---|---|
bool | if the hashSets are equal, otherwise
|
Type Parameters
Name | Description |
---|---|
E | The type of the elements of the hashSet |
EqualsExtension<K, V>(Dictionary<K, V>, Dictionary<K, V>)
Compares two dictionaries for equality. Equality means that the dictionaries have the same pairs regardless their order.
Declaration
public static bool EqualsExtension<K, V>(this Dictionary<K, V> dictionary, Dictionary<K, V> otherDictionary)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<K, V> | dictionary | The first dictionary |
Dictionary<K, V> | otherDictionary | The second dictionary |
Returns
Type | Description |
---|---|
bool | if the dictionaries are equal, otherwise
|
Type Parameters
Name | Description |
---|---|
K | The type of the keys of the dictionary |
V | The type of the values of the dictionary |
GetHashCodeExtension<E>(HashSet<E>)
Returns the hash code of a hashSet.
Declaration
public static int GetHashCodeExtension<E>(this HashSet<E> hashSet)
Parameters
Type | Name | Description |
---|---|---|
HashSet<E> | hashSet | The hashSet |
Returns
Type | Description |
---|---|
int | The hash code |
Type Parameters
Name | Description |
---|---|
E | The type of the elements of the hashSet |
GetHashCodeExtension<K, V>(Dictionary<K, V>)
Returns the hash code of a dictionary.
Declaration
public static int GetHashCodeExtension<K, V>(this Dictionary<K, V> dictionary)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<K, V> | dictionary | The dictionary |
Returns
Type | Description |
---|---|
int | The hash code |
Type Parameters
Name | Description |
---|---|
K | The type of the keys of the dictionary |
V | The type of the values of the dictionary |
ToStringExtension<E>(IEnumerable<E>)
Returns the string representation of an enumeration.
Declaration
public static string ToStringExtension<E>(this IEnumerable<E> enumeration)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<E> | enumeration | The enumeration |
Returns
Type | Description |
---|---|
string | The string representation |
Type Parameters
Name | Description |
---|---|
E | The type of the elements of the enumeration |
ToStringExtension<K, V>(Dictionary<K, V>)
Returns the string representation of a dictionary.
Declaration
public static string ToStringExtension<K, V>(this Dictionary<K, V> dictionary)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<K, V> | dictionary | The dictionary |
Returns
Type | Description |
---|---|
string | The string representation |
Type Parameters
Name | Description |
---|---|
K | The type of the keys of the dictionary |
V | The type of the values of the dictionary |