Class EnumerableExtensions
Inherited Members
Namespace: Libplanet.Common
Assembly: Libplanet.Common.dll
Syntax
public static class EnumerableExtensions
Methods
| Improve this Doc View SourceGreatest<TSource, TComparable>(IEnumerable<TSource>, Func<TSource, TComparable>)
Similar to Max<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)
method, but it returns the source element with the maximum value of the given
selector
, instead of the maximum value.
Declaration
public static TSource Greatest<TSource, TComparable>(this IEnumerable<TSource> source, Func<TSource, TComparable> selector)
where TComparable : IComparable<TComparable>
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TSource> | source | The source enumerable. |
Func<TSource, TComparable> | selector | A function to select the value to compare. |
Returns
Type | Description |
---|---|
TSource | The source element with the maximum value of the given
|
Type Parameters
Name | Description |
---|---|
TSource | The type of the source elements. |
TComparable | The type of the value to compare. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the source sequence is empty. |