|
CollectionExtensions.Minority<T> (IEnumerable<T> , T, Boolean, IEqualityComparer<T> ) Method
|
Returns the minority value in the collection, or defaultValue if no item represents the minority.
Namespace: GSF.CollectionsAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.244-beta+cf93f5f8aea4b941e9b426fe4e180c2bd85d31a2
Syntax[<ExtensionAttribute>]
static member Minority :
source : IEnumerable<'T> *
defaultValue : 'T *
?forwardSearch : bool *
?comparer : IEqualityComparer<'T>
(* Defaults:
let _forwardSearch = defaultArg forwardSearch true
let _comparer = defaultArg comparer null
*)
-> 'T
JavaScript does not support generic types or methods.
View SourceParameters
- source IEnumerable<T>
- An enumeration over which to find the minority element.
- defaultValue T
- Default value to return if no item represents the minority.
- forwardSearch Boolean (Optional)
- true to search forward in source; otherwise false to search backwards.
- comparer IEqualityComparer<T> (Optional)
- The IEqualityComparer<T> implementation to use when comparing keys, or null to use the default comparer for the type of the key.
Type Parameters
- T
- Type of elements in the source.
Return Value
TThe minority value in the collection.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerable<T>. 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).
See Also