Skip to main content
.NET 8.0+

XPQueryExtensions.FirstOrDefaultAsync Method

Name Parameters Description
FirstOrDefaultAsync<T>(IQueryable<T>, Expression<Func<T, Boolean>>, CancellationToken) static query, predicate, cancellationToken Asynchronously gets the first object that meets specified requirements in a selection. If the selection is empty, returns a default value for <T>.
FirstOrDefaultAsync<T>(IQueryable<T>, CancellationToken) static query, cancellationToken Asynchronously gets the first object in a selection. If the selection is empty, returns a default value for <T>.