Table of Contents

Interface IComparerProvider

Namespace
Nerdbank.MessagePack
Assembly
Nerdbank.MessagePack.dll

Provides IEqualityComparer<T> and/or IComparer<T> objects for given ITypeShape<T> objects.

public interface IComparerProvider

Methods

GetComparer<T>(ITypeShape<T>)

Gets an IComparer<T> for a type described by a given ITypeShape<T>.

IComparer<T>? GetComparer<T>(ITypeShape<T> shape)

Parameters

shape ITypeShape<T>

The shape of the type to be compared.

Returns

IComparer<T>

An instance of IComparer<T> if the provider has or can construct one for the given type shape; otherwise null.

Type Parameters

T

The type of object to be compared.

GetEqualityComparer<T>(ITypeShape<T>)

Gets an IEqualityComparer<T> for a type described by a given ITypeShape<T>.

IEqualityComparer<T>? GetEqualityComparer<T>(ITypeShape<T> shape)

Parameters

shape ITypeShape<T>

The shape of the type to be compared.

Returns

IEqualityComparer<T>

An instance of IEqualityComparer<T> if the provider has or can construct one for the given type shape; otherwise null.

Type Parameters

T

The type of object to be compared.