Table of Contents

Class DynamicComparer

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

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

public static class DynamicComparer
Inheritance
Object
DynamicComparer

Methods

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

Creates a dynamic instance of an System.Collections.Generic.IComparer<T> implementation wrapping System.Collections.Generic.IComparer`1.Compare(`0,`0) 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 System.Collections.Generic.IComparer<T> that serves as a sort order comparer for type T.

Type Parameters

T

The type of objects to compare.