QueryableExtensions.MinAsync Method
Asynchronously returns the minimum value of a sequence.
Assembly: EntityFramework (in EntityFramework.dll)
Name | Description | |
---|---|---|
![]() ![]() | 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. |
![]() ![]() | 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. |
QueryableExtensions.MinAsync<TSource> Method (IQueryable<TSource>)
Asynchronously returns the minimum value of a sequence.
Parameters
- source
-
Type:
System.Linq.IQueryable<TSource>
An IQueryable<T> that contains the elements to determine the minimum of.
Return Value
Type: System.Threading.Tasks.Task<TSource>A task that represents the asynchronous operation. The task result contains the minimum value in the sequence.
Type Parameters
- TSource
The type of the elements of source.
Exception | Condition |
---|---|
ArgumentNullException | source is null . |
InvalidOperationException | source does not implement IDbAsyncQueryProvider . |
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.
QueryableExtensions.MinAsync<TSource> Method (IQueryable<TSource>, CancellationToken)
Asynchronously returns the minimum value of a sequence.
public static Task<TSource> MinAsync<TSource>( this IQueryable<TSource> source, CancellationToken cancellationToken )
Parameters
- source
-
Type:
System.Linq.IQueryable<TSource>
An IQueryable<T> that contains the elements to determine the minimum of.
- cancellationToken
-
Type:
System.Threading.CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Return Value
Type: System.Threading.Tasks.Task<TSource>A task that represents the asynchronous operation. The task result contains the minimum value in the sequence.
Type Parameters
- TSource
The type of the elements of source.
Exception | Condition |
---|---|
ArgumentNullException | source is null . |
InvalidOperationException | source does not implement IDbAsyncQueryProvider . |
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.
QueryableExtensions.MinAsync<TSource, TResult> Method (IQueryable<TSource>, Expression<Func<TSource, TResult>>)
Asynchronously invokes a projection function on each element of a sequence and returns the minimum resulting value.
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static Task<TResult> MinAsync<TSource, TResult>( this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector )
Parameters
- source
-
Type:
System.Linq.IQueryable<TSource>
An IQueryable<T> that contains the elements to determine the minimum of.
- selector
-
Type:
System.Linq.Expressions.Expression<Func<TSource, TResult>>
A projection function to apply to each element.
Return Value
Type: System.Threading.Tasks.Task<TResult>A task that represents the asynchronous operation. The task result contains the minimum value in the sequence.
Type Parameters
- TSource
The type of the elements of source.
- TResult
The type of the value returned by the function represented by selector .
Exception | Condition |
---|---|
ArgumentNullException | source or selector is null . |
InvalidOperationException | source does not implement IDbAsyncQueryProvider . |
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.
QueryableExtensions.MinAsync<TSource, TResult> Method (IQueryable<TSource>, Expression<Func<TSource, TResult>>, CancellationToken)
Asynchronously invokes a projection function on each element of a sequence and returns the minimum resulting value.
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] public static Task<TResult> MinAsync<TSource, TResult>( this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken cancellationToken )
Parameters
- source
-
Type:
System.Linq.IQueryable<TSource>
An IQueryable<T> that contains the elements to determine the minimum of.
- selector
-
Type:
System.Linq.Expressions.Expression<Func<TSource, TResult>>
A projection function to apply to each element.
- cancellationToken
-
Type:
System.Threading.CancellationToken
A CancellationToken to observe while waiting for the task to complete.
Return Value
Type: System.Threading.Tasks.Task<TResult>A task that represents the asynchronous operation. The task result contains the minimum value in the sequence.
Type Parameters
- TSource
The type of the elements of source.
- TResult
The type of the value returned by the function represented by selector .
Exception | Condition |
---|---|
ArgumentNullException | source or selector is null . |
InvalidOperationException | source does not implement IDbAsyncQueryProvider . |
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.