Have you ever had to write a comparer for a specific type, only to be frustrated when you needed to write a second and third comparer for other types? Fear not, a generic comparer can take care of this for you! /// /// Compares two objects of any type. /// /// The type to be compared. public class GenericComparer : IComparer { // The compare method private readonly Func _compareMethod = null; /// /// The constructor.