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

REQUEST: LINQify foreach #5055

Closed
TonyValenti opened this issue Sep 7, 2015 · 1 comment
Closed

REQUEST: LINQify foreach #5055

TonyValenti opened this issue Sep 7, 2015 · 1 comment
Labels
Area-Language Design Resolution-Duplicate The described behavior is tracked in another issue

Comments

@TonyValenti
Copy link

Hi All,
I would like to suggest that the ForEach statement be enhanced to support syntax similar to the following:

foreach(var item in collection where item != null && item < 10 orderby item.Index desc) {
//Body of loop
}

this would be the same as writing:

foreach (var item in (from item in collection where item != null && item < 10 orderby item.Index desc select item)){
//Body of loop
}

@dsaf
Copy link

dsaf commented Sep 8, 2015

#1938 with different syntax.

@gafter gafter added the Resolution-Duplicate The described behavior is tracked in another issue label Nov 18, 2015
@gafter gafter closed this as completed Nov 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Language Design Resolution-Duplicate The described behavior is tracked in another issue
Projects
None yet
Development

No branches or pull requests

3 participants