EqualityComparer<T>.Create Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates an EqualityComparer<T> by using the specified delegates as the implementation of the comparer's Equals(T, T) and GetHashCode(T) methods.
public static System.Collections.Generic.EqualityComparer<T> Create (Func<T?,T?,bool> equals, Func<T,int>? getHashCode = default);
static member Create : Func<'T, 'T, bool> * Func<'T, int> -> System.Collections.Generic.EqualityComparer<'T>
Public Shared Function Create (equals As Func(Of T, T, Boolean), Optional getHashCode As Func(Of T, Integer) = Nothing) As EqualityComparer(Of T)
Parameters
The delegate to use to implement the Equals(T, T) method.
The delegate to use to implement the GetHashCode(T) method. If no delegate is supplied, calls to the resulting comparer's GetHashCode(T) will throw NotSupportedException.
Returns
The new comparer.
Exceptions
The equals
delegate was null
.
Applies to
Pripomienky
https://aka.ms/ContentUserFeedback.
Pripravujeme: V priebehu roka 2024 postupne zrušíme službu Problémy v službe GitHub ako mechanizmus pripomienok týkajúcich sa obsahu a nahradíme ju novým systémom pripomienok. Ďalšie informácie nájdete na stránke:Odoslať a zobraziť pripomienky pre