Queryable.MaxBy Metodo

Definizione

Overload

Nome Descrizione
MaxBy<TSource,TKey>(IQueryable<TSource>, Expression<Func<TSource,TKey>>)

Restituisce il valore massimo in un IQueryable<T> generico in base a una funzione del selettore di chiave specificata.

MaxBy<TSource,TKey>(IQueryable<TSource>, Expression<Func<TSource,TKey>>, IComparer<TKey>)

Restituisce il valore massimo in un IQueryable<T> generico in base a una funzione del selettore di chiave specificata.

MaxBy<TSource,TKey>(IQueryable<TSource>, Expression<Func<TSource,TKey>>, IComparer<TSource>)
Obsoleti.

Restituisce il valore massimo in un IQueryable<T> generico in base a una funzione del selettore di chiave specificata.

MaxBy<TSource,TKey>(IQueryable<TSource>, Expression<Func<TSource,TKey>>)

Origine:
Queryable.cs
Origine:
Queryable.cs
Origine:
Queryable.cs
Origine:
Queryable.cs
Origine:
Queryable.cs

Restituisce il valore massimo in un IQueryable<T> generico in base a una funzione del selettore di chiave specificata.

public:
generic <typename TSource, typename TKey>
[System::Runtime::CompilerServices::Extension]
 static TSource MaxBy(System::Linq::IQueryable<TSource> ^ source, System::Linq::Expressions::Expression<Func<TSource, TKey> ^> ^ keySelector);
public static TSource? MaxBy<TSource,TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,TKey>> keySelector);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Enumerating collections as IQueryable can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")]
public static TSource? MaxBy<TSource,TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,TKey>> keySelector);
static member MaxBy : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, 'Key>> -> 'Source
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Enumerating collections as IQueryable can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")>]
static member MaxBy : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, 'Key>> -> 'Source
<Extension()>
Public Function MaxBy(Of TSource, TKey) (source As IQueryable(Of TSource), keySelector As Expression(Of Func(Of TSource, TKey))) As TSource

Parametri di tipo

TSource

Tipo degli elementi di source.

TKey

Tipo di chiave per cui confrontare gli elementi.

Parametri

source
IQueryable<TSource>

Sequenza di valori per determinare il valore massimo di .

keySelector
Expression<Func<TSource,TKey>>

Funzione per estrarre la chiave per ogni elemento.

Valori restituiti

TSource

Valore con la chiave massima nella sequenza.

Attributi

Eccezioni

source è null.

Nessuna chiave estratta da source implementa l'interfaccia IComparable o IComparable<T> .

Si applica a

MaxBy<TSource,TKey>(IQueryable<TSource>, Expression<Func<TSource,TKey>>, IComparer<TKey>)

Origine:
Queryable.cs
Origine:
Queryable.cs

Restituisce il valore massimo in un IQueryable<T> generico in base a una funzione del selettore di chiave specificata.

public:
generic <typename TSource, typename TKey>
[System::Runtime::CompilerServices::Extension]
 static TSource MaxBy(System::Linq::IQueryable<TSource> ^ source, System::Linq::Expressions::Expression<Func<TSource, TKey> ^> ^ keySelector, System::Collections::Generic::IComparer<TKey> ^ comparer);
public static TSource? MaxBy<TSource,TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,TKey>> keySelector, System.Collections.Generic.IComparer<TKey>? comparer);
static member MaxBy : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, 'Key>> * System.Collections.Generic.IComparer<'Key> -> 'Source
<Extension()>
Public Function MaxBy(Of TSource, TKey) (source As IQueryable(Of TSource), keySelector As Expression(Of Func(Of TSource, TKey)), comparer As IComparer(Of TKey)) As TSource

Parametri di tipo

TSource

Tipo degli elementi di source.

TKey

Tipo di chiave per cui confrontare gli elementi.

Parametri

source
IQueryable<TSource>

Sequenza di valori per determinare il valore massimo di .

keySelector
Expression<Func<TSource,TKey>>

Funzione per estrarre la chiave per ogni elemento.

comparer
IComparer<TKey>

Oggetto IComparer<T> da confrontare.

Valori restituiti

TSource

Valore con la chiave massima nella sequenza.

Eccezioni

source è null.

Nessuna chiave estratta da source implementa l'interfaccia IComparable o IComparable<T> .

Si applica a

MaxBy<TSource,TKey>(IQueryable<TSource>, Expression<Func<TSource,TKey>>, IComparer<TSource>)

Origine:
Queryable.cs
Origine:
Queryable.cs
Origine:
Queryable.cs
Origine:
Queryable.cs
Origine:
Queryable.cs

Attenzione

The Queryable MinBy and MaxBy taking an IComparer<TSource> are obsolete. Use the new ones that take an IComparer<TKey>.

Restituisce il valore massimo in un IQueryable<T> generico in base a una funzione del selettore di chiave specificata.

public:
generic <typename TSource, typename TKey>
[System::Runtime::CompilerServices::Extension]
 static TSource MaxBy(System::Linq::IQueryable<TSource> ^ source, System::Linq::Expressions::Expression<Func<TSource, TKey> ^> ^ keySelector, System::Collections::Generic::IComparer<TSource> ^ comparer);
[System.Obsolete("The Queryable MinBy and MaxBy taking an IComparer<TSource> are obsolete. Use the new ones that take an IComparer<TKey>.", DiagnosticId="SYSLIB0061", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static TSource? MaxBy<TSource,TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,TKey>> keySelector, System.Collections.Generic.IComparer<TSource>? comparer);
public static TSource? MaxBy<TSource,TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,TKey>> keySelector, System.Collections.Generic.IComparer<TSource>? comparer);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Enumerating collections as IQueryable can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")]
public static TSource? MaxBy<TSource,TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,TKey>> keySelector, System.Collections.Generic.IComparer<TSource>? comparer);
[<System.Obsolete("The Queryable MinBy and MaxBy taking an IComparer<TSource> are obsolete. Use the new ones that take an IComparer<TKey>.", DiagnosticId="SYSLIB0061", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
[<System.Runtime.CompilerServices.OverloadResolutionPriority(-1)>]
static member MaxBy : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, 'Key>> * System.Collections.Generic.IComparer<'Source> -> 'Source
static member MaxBy : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, 'Key>> * System.Collections.Generic.IComparer<'Source> -> 'Source
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Enumerating collections as IQueryable can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")>]
static member MaxBy : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, 'Key>> * System.Collections.Generic.IComparer<'Source> -> 'Source
<Extension()>
Public Function MaxBy(Of TSource, TKey) (source As IQueryable(Of TSource), keySelector As Expression(Of Func(Of TSource, TKey)), comparer As IComparer(Of TSource)) As TSource

Parametri di tipo

TSource

Tipo degli elementi di source.

TKey

Tipo di chiave per cui confrontare gli elementi.

Parametri

source
IQueryable<TSource>

Sequenza di valori per determinare il valore massimo di .

keySelector
Expression<Func<TSource,TKey>>

Funzione per estrarre la chiave per ogni elemento.

comparer
IComparer<TSource>

Oggetto IComparer<T> da confrontare.

Valori restituiti

TSource

Valore con la chiave massima nella sequenza.

Attributi

Eccezioni

source è null.

Nessuna chiave estratta da source implementa l'interfaccia IComparable o IComparable<T> .

Si applica a