.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

XPQueryExtensions.MaxAsync<T, TResult>(IQueryable<T>, Expression<Func<T, TResult>>, CancellationToken) Method

Asynchronously gets the maximum value from a specified query. Uses a lambda expression to obtain values.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v20.2.dll

Declaration

public static Task<TResult> MaxAsync<T, TResult>(
    this IQueryable<T> query,
    Expression<Func<T, TResult>> selector,
    CancellationToken cancellationToken = default(CancellationToken)
)
<ExtensionAttribute>
Public Shared Function MaxAsync(Of T, TResult)(
    query As IQueryable(Of T),
    selector As Expression(Of Func(Of T, TResult)),
    cancellationToken As CancellationToken = Nothing
) As Task(Of TResult)

Parameters

Name Type Description
query IQueryable<T>

An XPQuery<T> that specifies a persistent object selection.

selector Expression<Func<T, TResult>>

A lambda expression that gets a value from a persistent object.

Optional Parameters

Name Type Default Description
cancellationToken CancellationToken

null

A CancellationToken object that delivers a cancellation notice to the running operation.

Type Parameters

Name
T
TResult

Returns

Type Description
Task<TResult>

A Task that returns an object. This object is the maximum value.

See Also