Queryable.MinBy Metod

Definition

Överlagringar

Name Description
MinBy<TSource,TKey>(IQueryable<TSource>, Expression<Func<TSource,TKey>>)

Returnerar minimivärdet i ett allmänt IQueryable<T> värde enligt en angiven nyckelväljare.

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

Returnerar minimivärdet i ett allmänt IQueryable<T> värde enligt en angiven nyckelväljare.

MinBy<TSource,TKey>(IQueryable<TSource>, Expression<Func<TSource,TKey>>, IComparer<TSource>)
Föråldrad.

Returnerar minimivärdet i ett allmänt IQueryable<T> värde enligt en angiven nyckelväljare.

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

Källa:
Queryable.cs
Källa:
Queryable.cs
Källa:
Queryable.cs
Källa:
Queryable.cs
Källa:
Queryable.cs

Returnerar minimivärdet i ett allmänt IQueryable<T> värde enligt en angiven nyckelväljare.

public:
generic <typename TSource, typename TKey>
[System::Runtime::CompilerServices::Extension]
 static TSource MinBy(System::Linq::IQueryable<TSource> ^ source, System::Linq::Expressions::Expression<Func<TSource, TKey> ^> ^ keySelector);
public static TSource? MinBy<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? MinBy<TSource,TKey>(this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,TKey>> keySelector);
static member MinBy : 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 MinBy : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, 'Key>> -> 'Source
<Extension()>
Public Function MinBy(Of TSource, TKey) (source As IQueryable(Of TSource), keySelector As Expression(Of Func(Of TSource, TKey))) As TSource

Typparametrar

TSource

Typen av element sourcei .

TKey

Vilken typ av nyckel som element ska jämföras med.

Parametrar

source
IQueryable<TSource>

En sekvens med värden för att fastställa minimivärdet för.

keySelector
Expression<Func<TSource,TKey>>

En funktion för att extrahera nyckeln för varje element.

Returer

TSource

Värdet med miniminyckeln i sekvensen.

Attribut

Undantag

source är null.

Ingen nyckel som extraherats från source implementerar IComparable gränssnittet eller IComparable<T> .

Gäller för

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

Källa:
Queryable.cs
Källa:
Queryable.cs

Returnerar minimivärdet i ett allmänt IQueryable<T> värde enligt en angiven nyckelväljare.

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

Typparametrar

TSource

Typen av element sourcei .

TKey

Vilken typ av nyckel som element ska jämföras med.

Parametrar

source
IQueryable<TSource>

En sekvens med värden för att fastställa minimivärdet för.

keySelector
Expression<Func<TSource,TKey>>

En funktion för att extrahera nyckeln för varje element.

comparer
IComparer<TKey>

För IComparer<T> att jämföra nycklar.

Returer

TSource

Värdet med miniminyckeln i sekvensen.

Undantag

source är null.

Ingen nyckel som extraherats från source implementerar IComparable gränssnittet eller IComparable<T> .

Gäller för

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

Källa:
Queryable.cs
Källa:
Queryable.cs
Källa:
Queryable.cs
Källa:
Queryable.cs
Källa:
Queryable.cs

Varning

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

Returnerar minimivärdet i ett allmänt IQueryable<T> värde enligt en angiven nyckelväljare.

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

Typparametrar

TSource

Typen av element sourcei .

TKey

Vilken typ av nyckel som element ska jämföras med.

Parametrar

source
IQueryable<TSource>

En sekvens med värden för att fastställa minimivärdet för.

keySelector
Expression<Func<TSource,TKey>>

En funktion för att extrahera nyckeln för varje element.

comparer
IComparer<TSource>

För IComparer<T> att jämföra nycklar.

Returer

TSource

Värdet med miniminyckeln i sekvensen.

Attribut

Undantag

source är null.

Ingen nyckel som extraherats från source implementerar IComparable gränssnittet eller IComparable<T> .

Gäller för