QueryableExtensions.MinAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
MinAsync<TSource,TResult>(IQueryable<TSource>, Expression<Func<TSource,TResult>>) |
Asynchronously invokes a projection function on each element of a sequence and returns the minimum resulting value. |
MinAsync<TSource,TResult>(IQueryable<TSource>, Expression<Func<TSource,TResult>>, CancellationToken) |
Asynchronously invokes a projection function on each element of a sequence and returns the minimum resulting value. |
MinAsync<TSource>(IQueryable<TSource>) |
Asynchronously returns the minimum value of a sequence. |
MinAsync<TSource>(IQueryable<TSource>, CancellationToken) |
Asynchronously returns the minimum value of a sequence. |
MinAsync<TSource,TResult>(IQueryable<TSource>, Expression<Func<TSource,TResult>>)
Asynchronously invokes a projection function on each element of a sequence and returns the minimum resulting value.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<TResult> MinAsync<TSource,TResult> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,TResult>> selector);
static member MinAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, 'Result>> -> System.Threading.Tasks.Task<'Result>
<Extension()>
Public Function MinAsync(Of TSource, TResult) (source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, TResult))) As Task(Of TResult)
Type Parameters
- TSource
The type of the elements of source
.
- TResult
The type of the value returned by the function represented by selector
.
Parameters
- source
- IQueryable<TSource>
An IQueryable<T> that contains the elements to determine the minimum of.
- selector
- Expression<Func<TSource,TResult>>
A projection function to apply to each element.
Returns
A task that represents the asynchronous operation. The task result contains the minimum value in the sequence.
- Attributes
Exceptions
source
or
selector
is
null
.
source
doesn't implement
IDbAsyncQueryProvider
.
Remarks
Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
Applies to
MinAsync<TSource,TResult>(IQueryable<TSource>, Expression<Func<TSource,TResult>>, CancellationToken)
Asynchronously invokes a projection function on each element of a sequence and returns the minimum resulting value.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<TResult> MinAsync<TSource,TResult> (this System.Linq.IQueryable<TSource> source, System.Linq.Expressions.Expression<Func<TSource,TResult>> selector, System.Threading.CancellationToken cancellationToken);
static member MinAsync : System.Linq.IQueryable<'Source> * System.Linq.Expressions.Expression<Func<'Source, 'Result>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Type Parameters
- TSource
The type of the elements of source
.
- TResult
The type of the value returned by the function represented by selector
.
Parameters
- source
- IQueryable<TSource>
An IQueryable<T> that contains the elements to determine the minimum of.
- selector
- Expression<Func<TSource,TResult>>
A projection function to apply to each element.
- cancellationToken
- CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Returns
A task that represents the asynchronous operation. The task result contains the minimum value in the sequence.
- Attributes
Exceptions
source
or
selector
is
null
.
source
doesn't implement
IDbAsyncQueryProvider
.
Remarks
Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
Applies to
MinAsync<TSource>(IQueryable<TSource>)
Asynchronously returns the minimum value of a sequence.
public static System.Threading.Tasks.Task<TSource> MinAsync<TSource> (this System.Linq.IQueryable<TSource> source);
static member MinAsync : System.Linq.IQueryable<'Source> -> System.Threading.Tasks.Task<'Source>
<Extension()>
Public Function MinAsync(Of TSource) (source As IQueryable(Of TSource)) As Task(Of TSource)
Type Parameters
- TSource
The type of the elements of source
.
Parameters
- source
- IQueryable<TSource>
An IQueryable<T> that contains the elements to determine the minimum of.
Returns
A task that represents the asynchronous operation. The task result contains the minimum value in the sequence.
Exceptions
source
is
null
.
source
doesn't implement
IDbAsyncQueryProvider
.
Remarks
Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
Applies to
MinAsync<TSource>(IQueryable<TSource>, CancellationToken)
Asynchronously returns the minimum value of a sequence.
public static System.Threading.Tasks.Task<TSource> MinAsync<TSource> (this System.Linq.IQueryable<TSource> source, System.Threading.CancellationToken cancellationToken);
static member MinAsync : System.Linq.IQueryable<'Source> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Source>
Type Parameters
- TSource
The type of the elements of source
.
Parameters
- source
- IQueryable<TSource>
An IQueryable<T> that contains the elements to determine the minimum of.
- cancellationToken
- CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Returns
A task that represents the asynchronous operation. The task result contains the minimum value in the sequence.
Exceptions
source
is
null
.
source
doesn't implement
IDbAsyncQueryProvider
.
Remarks
Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
Applies to
Entity Framework