LambdaKeyComparer<TSource, TKey> Class

Summary

A System.Collections.Generic.Comparer`1 that delegates comparison to a key-selector function, with an optional inner comparer for the key type.
Assembly
GitVersion.Core.dll
Namespace
GitVersion.Helpers
Base Types
graph BT Type-->Base0["Comparer<TSource>"] Type["LambdaKeyComparer<TSource, TKey>"] class Type type-node

Syntax

public class LambdaKeyComparer<TSource, TKey> : Comparer<TSource> where TSource : class

Attributes

Type Description
NullableContextAttribute
NullableAttribute

Type Parameters

Name Description
TSource
TKey

Constructors

Name Summary
LambdaKeyComparer(Func<TSource, TKey>, IComparer<TKey>) A System.Collections.Generic.Comparer`1 that delegates comparison to a key-selector function, with an optional inner comparer for the key type.

Methods

Name Value Summary
Compare(TSource, TSource) int
Compares x and y by applying the key selector and delegating to the inner comparer.

Extension Methods

Name Value Summary
NotNull<LambdaKeyComparer<TSource, TKey>>(string) T
Throws System.ArgumentNullException when value is null; otherwise returns the value.