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

XPQueryExtensions.LastOrDefaultAsync Method

Name Parameters Description
LastOrDefaultAsync<T>(IQueryable<T>, CancellationToken) static query, cancellationToken

Asynchronously gets the last object in a selection. If the selection is empty, returns a default value for <T>.

LastOrDefaultAsync<T>(IQueryable<T>, Expression<Func<T, Boolean>>, CancellationToken) static query, predicate, cancellationToken

Asynchronously gets the last object that meets specified requirements in a selection. If the selection is empty, returns a default value for <T>.