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 LINQ APIs for Index and Range (#28776) #48559

Merged
merged 41 commits into from
Feb 22, 2021

Conversation

Dixin
Copy link
Contributor

@Dixin Dixin commented Feb 20, 2021

Add LINQ APIs for index and range:

  • Enumerable
    • ElementAt(Index)
    • ElementAtOrDefault(Index)
    • Take(Range)
  • Queryable
    • ElementAt(Index)
    • ElementAtOrDefault(Index)
    • Take(Range)

Close #28776.

This is to replace PR #47950. I initially opened PR #47950, but accidentally closed it, and I cannot reopen it.

@stephentoub @eiriktsarpalis Please review this PR. Sorry for the inconvenience.

Dixin added 30 commits January 26, 2021 23:46
@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost
Copy link

ghost commented Feb 20, 2021

Tagging subscribers to this area: @eiriktsarpalis
See info in area-owners.md if you want to be subscribed.

Issue Details

Add LINQ APIs for index and range:

  • Enumerable
    • ElementAt(Index)
    • ElementAtOrDefault(Index)
    • Take(Range)
  • Queryable
    • ElementAt(Index)
    • ElementAtOrDefault(Index)
    • Take(Range)

Close #28776.

This is to replace PR #47950. I initially opened PR #47950, but accidentally closed it, and I cannot reopen it.

@stephentoub @eiriktsarpalis Please review this PR. Sorry for the inconvenience.

Author: Dixin
Assignees: -
Labels:

area-System.Linq, new-api-needs-documentation

Milestone: -

Copy link
Member

@eiriktsarpalis eiriktsarpalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

@eiriktsarpalis
Copy link
Member

CI failures seem unrelated, merging away.

@Dixin
Copy link
Contributor Author

Dixin commented Feb 22, 2021

@eiriktsarpalis @stephentoub Thank you for all the help. As we discussed, I opened a new proposal for optimization #48631. I am already working on the coding, will send PR once it is done.

@ghost ghost locked as resolved and limited conversation to collaborators Mar 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal (& implementation): LINQ APIs to enable C# 8.0 index and range for IEnumerable<T>
3 participants