I suggest you ...

Shorthand to execute method in foreach loop

Introduce the new syntax *. to C# that can be used like

someEnumerable*.SomeMethod();

which is shorthand for

foreach ( var someItem in someEnumerable )
someItem.SomeMethod();

This is like the ForEach method but better!

1 vote
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Adrian shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Adrian commented  ·   ·  Flag as inappropriate

    I should also add that it could be combined with ?. as in

    someEnumerable?*.SomeMethod();

Feedback and Knowledge Base