Show / Hide Table of Contents

Class EnumerableExtensions

Inheritance
Object
EnumerableExtensions
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Libplanet.Common
Assembly: Libplanet.Common.dll
Syntax
public static class EnumerableExtensions

Methods

| Improve this Doc View Source

Greatest<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 selector.

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.

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2023 Planetarium