FearTheCowboy.Extensions.Core by Garrett Serack (@FearTheCowboy)

<PackageReference Include="FearTheCowboy.Extensions.Core" Version="2.0.0-beta-10145" />


public class Comparer<T> : IComparer<T>
A generic implementation of a IComparer that takes a delegate to compare with
using System; using System.Collections.Generic; namespace FearTheCowboy.Extensions.Core { public class Comparer<T> : IComparer<T> { private readonly Func<T, T, int> _compareFuction; public Comparer(Func<T, T, int> compareFn) { _compareFuction = compareFn; } public int Compare(T x, T y) { return _compareFuction(x, y); } } }