Home EnumerableExtensions Class
EnumerableExtensions Class
Cancel

EnumerableExtensions Class

Namespace: Json.Schema

Inheritance: EnumerableExtensions 🡒 object

More extensions on System.Collections.Generic.IEnumerable`1.

Methods

ContentsEqual(this IReadOnlyList<T> collection, IReadOnlyList<T> other)

Determines contents-based equality: each element appears equally in each set.

Declaration

1
public static bool ContentsEqual(this IReadOnlyList<T> collection, IReadOnlyList<T> other)
ParameterTypeDescription
collectionIReadOnlyList<T>The first collection.
otherIReadOnlyList<T>The second collection.

Returns

true if the collections contain the same number of the same elements; false otherwise.

ContentsEqual(this IReadOnlyList<T> collection, IReadOnlyList<T> other, IEqualityComparer<T> comparer)

Determines contents-based equality: each element appears equally in each set.

Declaration

1
public static bool ContentsEqual(this IReadOnlyList<T> collection, IReadOnlyList<T> other, IEqualityComparer<T> comparer)
ParameterTypeDescription
collectionIReadOnlyList<T>The first collection.
otherIReadOnlyList<T>The second collection.
comparerIEqualityComparer<T>A custom equality comparer.

Returns

true if the collections contain the same number of the same elements; false otherwise.

GetStringDictionaryHashCode(this IDictionary<string, T> collection)

Gets a string-dictionary-oriented hash code by combining the hash codes of its elements.

Declaration

1
public static int GetStringDictionaryHashCode(this IDictionary<string, T> collection)
ParameterTypeDescription
collectionIDictionary<string, T>The collection of elements.

Returns

A singular integer value that represents the collection.

Remarks

This can be used to correctly compare the contents of string dictionaries where key ordering is not important.

GetStringDictionaryHashCode(this IReadOnlyDictionary<string, T> collection)

Gets a string-dictionary-oriented hash code by combining the hash codes of its elements.

Declaration

1
public static int GetStringDictionaryHashCode(this IReadOnlyDictionary<string, T> collection)
ParameterTypeDescription
collectionIReadOnlyDictionary<string, T>The collection of elements.

Returns

A singular integer value that represents the collection.

Remarks

This can be used to correctly compare the contents of string dictionaries where key ordering is not important.

GetUnorderedCollectionHashCode(this IEnumerable<T> collection)

Gets a collection-oriented hash code by combining the hash codes of its elements.

Declaration

1
public static int GetUnorderedCollectionHashCode(this IEnumerable<T> collection)
ParameterTypeDescription
collectionIEnumerable<T>The collection of elements.

Returns

A singular integer value that represents the collection.

Remarks

This can be used to correctly compare the contents of collections.

Contents