Table of Contents

Class DynamicComparer

Namespace
Cuemon.Collections.Generic
Assembly
Cuemon.Core.dll

Provides a factory based way to create and wrap an IComparer<T> implementation.

public static class DynamicComparer
Inheritance
DynamicComparer

Methods

Create<T>(Func<T, T, Int32>)

Creates a dynamic instance of an IComparer<T> implementation wrapping Compare(T, T) through comparer.

public static IComparer<T> Create<T>(Func<T, T, int> comparer)

Parameters

comparer Func<T, T, Int32>

The function delegate that performs a comparison of two objects of the same type and returns a value indicating whether one object is less than, equal to, or greater than the other.

Returns

IComparer<T>

A dynamic instance of IComparer<T> that serves as a sort order comparer for type T.

Type Parameters

T

The type of objects to compare.