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

[Feature] DistinctBy for IAsyncEnumerable #1986

Open
WhatzGames opened this issue Sep 14, 2023 · 0 comments
Open

[Feature] DistinctBy for IAsyncEnumerable #1986

WhatzGames opened this issue Sep 14, 2023 · 0 comments

Comments

@WhatzGames
Copy link

For the IEnumerable DistinctBy was already added in .Net 6.

This feature is currently missing for the IAsynEnumerable.

I therefore propose to add the following API:

public static IAsyncEnumerable<TSource> DistinctBy<TSource, TKey>(this IAsyncEnumerable<T> source,  Func<TSource, TKey> keySelector);
public static IAsyncEnumerable<TSource> DistinctBy<TSource, TKey>(this IAsyncEnumerable<T> source,  Func<TSource, TKey> keySelector, IEqualityComparer<TKey>);
public static IAsyncEnumerable<TSource> DistinctBy<TSource, TKey>(this IAsyncEnumerable<T> source,  Func<TSource, ValueTask<TKey>> keySelector);
public static IAsyncEnumerable<TSource> DistinctBy<TSource, TKey>(this IAsyncEnumerable<T> source,  Func<TSource, valueTask<TKey>> keySelector, IEqualityComparer<TKey>);

If approved, I would like to give it a try myself.

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

1 participant