CollectionExtensionsMinorityByTSource, TKey(IEnumerableTSource, FuncTSource, TKey, Boolean, IEqualityComparerTKey) Method
Returns the minority value in the collection, or default type value if no item represents the majority.
Namespace: Gemstone.Collections.CollectionExtensionsAssembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public static TSource MinorityBy<TSource, TKey>(
this IEnumerable<TSource>? source,
Func<TSource, TKey> keySelector,
bool forwardSearch = true,
IEqualityComparer<TKey>? comparer = null
)
<ExtensionAttribute>
Public Shared Function MinorityBy(Of TSource, TKey) (
source As IEnumerable(Of TSource),
keySelector As Func(Of TSource, TKey),
Optional forwardSearch As Boolean = true,
Optional comparer As IEqualityComparer(Of TKey) = Nothing
) As TSource
public:
[ExtensionAttribute]
generic<typename TSource, typename TKey>
static TSource MinorityBy(
IEnumerable<TSource>^ source,
Func<TSource, TKey>^ keySelector,
bool forwardSearch = true,
IEqualityComparer<TKey>^ comparer = nullptr
)
JavaScript does not support generic types or methods.
- source IEnumerableTSource
- An enumeration over which to find the majority element.
- keySelector FuncTSource, TKey
- A delegate that takes an object and produces the key for comparison.
- forwardSearch Boolean (Optional)
- true to search forward in source; otherwise false to search backwards.
- comparer IEqualityComparerTKey (Optional)
- The IEqualityComparerT implementation to use when comparing keys, or null to use the default comparer for the type of the key.
- TSource
- Type of elements in the source.
- TKey
- The generic Type of the objects to be compared.
TSourceThe minority value in the collection.In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableTSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).