Skip to content

MaxAsync Method ​

Definition ​

  • Namespace: JASE.Database
  • Assembly: JASE.Database.dll

Overloads ​

NameDescription
Task<Nullable<decimal>> MaxAsync(Expression<Func<T, object>> property, bool distinct = null, IPredicateNode predicate = null, CancellationToken cancellationToken = null)Computes the maximum value of the specified property for rows matching the optional predicate.
Task<TResult> MaxAsync(Expression<Func<T, TResult>> property, bool distinct = null, IPredicateNode predicate = null, CancellationToken cancellationToken = null)Computes the maximum value of the specified property for rows matching the optional predicate.

Task<Nullable<decimal>> MaxAsync(Expression<Func<T, object>> property, bool distinct = null, IPredicateNode predicate = null, CancellationToken cancellationToken = null) ​

csharp
Task<Nullable<decimal>> MaxAsync(Expression<Func<T, object>> property, bool distinct = null, IPredicateNode predicate = null, CancellationToken cancellationToken = null)

Computes the maximum value of the specified property for rows matching the optional predicate.

Type parameters ​

NameDescription
TThe entity (row) type.

Parameters ​

NameDescription
ctCancellation token.
distinctIf true, computes over distinct values.
predicateOptional predicate to filter rows.
propertyProperty selector to aggregate.

Returns ​

The computed maximum, or null if no rows match.

Task<TResult> MaxAsync(Expression<Func<T, TResult>> property, bool distinct = null, IPredicateNode predicate = null, CancellationToken cancellationToken = null) ​

csharp
Task<TResult> MaxAsync(Expression<Func<T, TResult>> property, bool distinct = null, IPredicateNode predicate = null, CancellationToken cancellationToken = null)

Computes the maximum value of the specified property for rows matching the optional predicate.

Type parameters ​

NameDescription
TThe entity (row) type.
TResultThe projected property type.

Parameters ​

NameDescription
ctCancellation token.
distinctIf true, computes over distinct values.
predicateOptional predicate to filter rows.
propertyProperty selector to aggregate.

Returns ​

The computed maximum, or default if no rows match (provider-dependent for nullable types).