Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MaxByAsync and MinByAsync #27977

Closed
CollinAlpert opened this issue May 7, 2022 · 3 comments
Closed

Add MaxByAsync and MinByAsync #27977

CollinAlpert opened this issue May 7, 2022 · 3 comments

Comments

@CollinAlpert
Copy link

CollinAlpert commented May 7, 2022

.NET 6 introduces the MaxBy and MinBy APIs. I would like to query the database using these methods, more specifically the async version.

I am proposing to add the following methods to EntityFrameworkQueryableExtensions:

public static Task<TSource> MaxByAsync<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> selector, CancellationToken cancellationToken = default);

public static Task<TSource> MinByAsync<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> selector, CancellationToken cancellationToken = default);

I am happy to provide a PR as soon as I get feedback on this issue.

@ajcvickers
Copy link
Member

Duplicate of #25566.

@CollinAlpert
Copy link
Author

@ajcvickers I saw that issue but decided my issue was different, as I am proposing to add async versions. My apologies for raising a duplicate.

@ajcvickers
Copy link
Member

@CollinAlpert Sync and async should be done at the same time.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants